Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Attempts to obtain ownership of the mutex without blocking.
bool try_lock() _NOEXCEPT;
Return Value
true if the method successfully obtained ownership of the mutex or if the calling thread already owns the mutex; otherwise, false.
Remarks
If the calling thread already owns the mutex, the function immediately returns true, and the previous lock remains in effect.
Requirements
Header: mutex
Namespace: std