A RetroSearch Logo

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

Search Query:

Showing content from https://cplusplus.com/reference/mutex/recursive_mutex/lock/ below:

public member function

<mutex>

std::recursive_mutex::lock

Lock recursive mutex

The calling thread locks the recursive_mutex, blocking if necessary:


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.

Note that the order in which different concurrent locks are scheduled to return is unspecified, and not necessarily related to the order in which they are locked (depending on the system and library implementation).



Parameters none

Return value none

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

Exception safetyBasic guarantee: if an exception is thrown by this member function, the recursive_mutex object is left in a valid state. Further, a lock is never acquired by the thread that made the throwing call.

If the call fails, a system_error exception is thrown:


Depending on the library implementation, this member function may also throw exceptions to report other situations.

See also
recursive_mutex::try_lock
Lock mutex if not locked by other threads (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