Mono Class Library: System.Threading.Monitor Overview | MembersSystem.Threading.Monitor.Wait Method |
Releases the lock on an object and blocks the current thread until it reacquires the lock or until a specified amount of time elapses. [Edit]
|
true if the lock was reacquired before the specified time elapsed; otherwise, false. [Edit]
Type Reason ArgumentNullException obj is null. [Edit] System.Threading.SynchronizationLockException The calling thread does not own the lock for the specified object. [Edit] ArgumentOutOfRangeException The value of millisecondsTimeout is negative, and not equal to Timeout.Infinite . [Edit]
If successful, this method reacquires an exclusive lock on obj.
This method behaves identically to Monitor.Wait(object, int, bool) (obj), except that it does not block indefinitely unless Timeout.Infinite is specified for millisecondsTimeout . Once the specified time has elapsed, this method returns a value that indicates whether the lock has been reacquired by the caller. If millisecondsTimeout equals 0, this method returns immediately.
Note: This method is called when the caller is waiting for a change in the state of the object, which occurs as a result of another thread's operations on the object. For additional details, see Monitor.Wait(object, int, bool) (obj).[Edit]
Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0