Attempts, for the specified number of milliseconds, to acquire an exclusive lock on the specified object.
true if the current thread acquired the lock; otherwise, false.
Type Reason ArgumentNullException obj is null. ArgumentOutOfRangeException millisecondsTimeout is negative, and not equal to Timeout.Infinite .
If successful, this method acquires an exclusive lock on obj.
If millisecondsTimeout equals Timeout.Infinite, this method is equivalent to Monitor.Enter(object) (obj). If millisecondsTimeout equals zero, this method is equivalent to Monitor.TryEnter(object) (obj).
Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0