Releases the lock on an object and blocks the current thread until it reacquires the lock or until a specified amount of time elapses.
true if the lock was reacquired before the specified time elapsed; otherwise, false.
Type Reason ArgumentNullException obj is null. System.Threading.SynchronizationLockException The calling thread does not own the lock for the specified object. ArgumentOutOfRangeException The value of millisecondsTimeout is negative, and not equal to Timeout.Infinite .
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).
Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0