SynchronizedBlock.Wait method (1 of 3)

Releases the lock on an object and blocks the current thread until it reacquires the lock.

public virtual bool Wait()

Return Value

True if the call returned because the caller reacquired the lock for the specified object. This method does not return if the lock is not reacquired.

See Also


SynchronizedBlock.Wait method (2 of 3)

Releases the lock on an object and blocks the current thread until it reacquires the lock. If the specified time-out interval elapses, the thread enters the ready queue.

public virtual bool Wait(int millisecondsTimeout)
parameter description
millisecondsTimeout The number of milliseconds to wait before the thread enters the ready queue.

Return Value

True if the lock was reacquired before the specified time elapsed; false if the lock was reacquired after the specified time elapsed. The method does not return until the lock is reacquired.

See Also


SynchronizedBlock.Wait method (3 of 3)

Releases the lock on an object and blocks the current thread until it reacquires the lock. If the specified time-out interval elapses, the thread enters the ready queue.

public virtual bool Wait(TimeSpan timeout)
parameter description
timeout A System.TimeSpan representing the amount of time to wait before the thread enters the ready queue.

Return Value

True if the lock was reacquired before the specified time elapsed; false if the lock was reacquired after the specified time elapsed. The method does not return until the lock is reacquired.

See Also