WaitOne()

Mutex::WaitOne() method

Locks mutex. Performs unlimited waiting if neccessary.

virtual bool System::Threading::Mutex::WaitOne() override

Return Value

Always returns true as it does not return until mutex is locked.

Mutex::WaitOne(int) method

Locks mutex. Performs waiting if neccessary.

virtual bool System::Threading::Mutex::WaitOne(int millisecondsTimeout) override

Arguments

ParameterTypeDescription
millisecondsTimeoutintWaiting timeout in milliseconds.

Return Value

Returns true if mutex was locked or false if timeout exceeded.

Mutex::WaitOne(TimeSpan) method

Locks mutex. Performs waiting if neccessary.

virtual bool System::Threading::Mutex::WaitOne(TimeSpan timeout) override

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

Returns true if mutex was locked or false if timeout exceeded.

See Also