NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Monitor.Exit

Releases the monitor lock. If one or more threads are waiting to acquire the lock, and the current thread has executed Exit as many times as it has executed Enter, one of the threads will be unblocked and allowed to proceed.

[Visual Basic]
Public Shared Sub Exit( _
   ByVal obj As Object _
)
[C#]
public static void Exit(
   object obj
);
[C++]
public: static void Exit(
   Object* obj
);
[JScript]
public static function Exit(
   obj : Object
);

Parameters

obj
Object on which to release the monitor lock.

Exceptions

Exception Type Condition
ArgumentNullException If obj is a null reference (in Visual Basic Nothing).
ArgumentException If obj is a value type.
SynchronizationLockException If the current thread does not own the lock.

Remarks

If the current thread owns the lock, the lock count is decremented for the specified object. If the count goes to zero (Exit has been executed as many times as Enter), other threads waiting on the object can acquire the lock.

See Also

Monitor Class | Monitor Members | System.Threading Namespace | Thread