public class SynchronizationLockException : SystemException
Object
Exception
SystemException
SynchronizationLockException
mscorlib
BCL
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.
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).
System.Threading Namespace
SynchronizationLockException Constructors
SynchronizationLockException() Constructor
SynchronizationLockException(System.String) Constructor
SynchronizationLockException(System.String, System.Exception) Constructor
public SynchronizationLockException();
Constructs and initializes a new instance of the SynchronizationLockException class.
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
.
System.Threading.SynchronizationLockException Class, System.Threading Namespace
public SynchronizationLockException(string message);
Constructs and initializes a new instance of the SynchronizationLockException class.
- 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.
This constructor initializes the System.Threading.SynchronizationLockException.Message property of the new instance using message. If message isnull
, 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
.
System.Threading.SynchronizationLockException Class, System.Threading Namespace
public SynchronizationLockException(string message, Exception innerException);
Constructs and initializes a new instance of the SynchronizationLockException class.
- 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 .
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 isnull
, 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.]
System.Threading.SynchronizationLockException Class, System.Threading Namespace