WaitOne()

WaitHandle::WaitOne() method

Waits for the handle to fire for unlimited period.

virtual bool System::Threading::WaitHandle::WaitOne()

Return Value

Always returns true as no timeout occurs.

WaitHandle::WaitOne(int) method

Waits for the handle to fire.

virtual bool System::Threading::WaitHandle::WaitOne(int millisecondsTimeout)

Arguments

ParameterTypeDescription
millisecondsTimeoutintTimeout to wait for, in milliseconds; -1 means infinite waiting, 0 means check-and-return, positive values are timeouts.

Return Value

True if handle fired, false if timeout exceeded.

WaitHandle::WaitOne(TimeSpan) method

Waits for the handle to fire.

virtual bool System::Threading::WaitHandle::WaitOne(TimeSpan timeout)

Arguments

ParameterTypeDescription
timeoutTimeSpanA System::TimeSpan that represents the number of milliseconds to wait, or a System::TimeSpan that represents -1 milliseconds to wait indefinitely.

Return Value

True if handle fired, false if timeout exceeded.

WaitHandle::WaitOne(int, bool) method

Waits for the handle to fire.

virtual bool System::Threading::WaitHandle::WaitOne(int millisecondsTimeout, bool exitContext)

Arguments

ParameterTypeDescription
millisecondsTimeoutintTimeout to wait for, in milliseconds; -1 means infinite waiting, 0 means check-and-return, positive values are timeouts.
exitContextboolIf true, waiting should drop the lock on the handle before waiting for it.

Return Value

True if handle fired, false if timeout exceeded.

See Also