System.Threading.SynchronizationLockException Class

public class SynchronizationLockException : SystemException

Base Types

Object
  Exception
    SystemException
      SynchronizationLockException

Assembly

mscorlib

Library

BCL

Summary

Represents the error that occurs when a method requires the caller to own the lock on a given Monitor , and the method is invoked by a caller that does not own that lock.

Description

SynchronizationLockException is thrown if the System.Threading.Monitor.Pulse(System.Object), System.Threading.Monitor.PulseAll(System.Object), or System.Threading.Monitor.Wait(System.Object,System.Int32,System.Boolean) methods are invoked for a specified object, but the caller does not own the lock on that object.SynchronizationLockException is also thrown when the System.Threading.Monitor.Exit(System.Object) method is called to release the lock on an object, but the caller does not own the lock on that object.

To acquire the lock on an object, use System.Threading.Monitor.Enter(System.Object). To release the lock on an object, use System.Threading.Monitor.Exit(System.Object).

See Also

System.Threading Namespace

Members

SynchronizationLockException Constructors

SynchronizationLockException() Constructor
SynchronizationLockException(System.String) Constructor
SynchronizationLockException(System.String, System.Exception) Constructor


SynchronizationLockException() Constructor

public SynchronizationLockException();

Summary

Constructs and initializes a new instance of the SynchronizationLockException class.

Description

This constructor initializes the System.Threading.SynchronizationLockException.Message property of the new instance to a system-supplied message that describes the error, such as "Synchronization method was invoked from an unsynchronized block of code." This message takes into account the current system culture.

The System.Threading.SynchronizationLockException.InnerException property is initialized to null .

See Also

System.Threading.SynchronizationLockException Class, System.Threading Namespace

SynchronizationLockException(System.String) Constructor

public SynchronizationLockException(string message);

Summary

Constructs and initializes a new instance of the SynchronizationLockException class.

Parameters

message
A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

Description

This constructor initializes the System.Threading.SynchronizationLockException.Message property of the new instance using message. If message is null , the System.Threading.SynchronizationLockException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments.

The System.Threading.SynchronizationLockException.InnerException property is initialized to null .

See Also

System.Threading.SynchronizationLockException Class, System.Threading Namespace

SynchronizationLockException(System.String, System.Exception) Constructor

public SynchronizationLockException(string message, Exception innerException);

Summary

Constructs and initializes a new instance of the SynchronizationLockException class.

Parameters

message
A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
innerException
An instance of Exception that is the cause of the current exception. If innerException is non-null, then the current Exception was raised in a catch block handling innerException .

Description

This constructor initializes the System.Threading.SynchronizationLockException.Message property of the new instance using message and the System.Threading.SynchronizationLockException.InnerException property using innerException. If message is null , the System.Threading.SynchronizationLockException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments.

[Note: For more information on inner exceptions, see System.Exception.InnerException.]

See Also

System.Threading.SynchronizationLockException Class, System.Threading Namespace