A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/recursive_mutex::try_lock below:

public member function

<mutex>

std::recursive_mutex::try_lock
bool try_lock() noexcept;

Lock mutex if not locked by other threads

Attempts to lock the recursive_mutex, without blocking:


This function may fail spuriously when no other thread has a lock on the recursive_mutex, but repeated calls in these circumstances shall succeed at some point.

All lock and unlock operations on the recursive_mutex follow a single total order, with all visible effects synchronized between the lock operations and previous unlock operations on the same object.



Parameters none

Return valuetrue if the function succeeds in locking the recursive_mutex for the thread.
false otherwise.

Data races The recursive_mutex object is accessed/modified as an atomic operation (causes no data races).

Exception safetyNo-throw guarantee: never throws exceptions.

See also
recursive_mutex::lock
Lock recursive mutex (public member function)
recursive_mutex::unlock
Unlocks mutex (public member function)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4