A RetroSearch Logo

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

Search Query:

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

public member function

<mutex>

std::timed_mutex::lock

Lock timed mutex

The calling thread locks the timed_mutex, blocking if necessary (it behaves exactly as in mutex):


All lock and unlock operations on the timed_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 timed_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 timed_mutex object is left in a valid state. Further, a lock is never acquired by the thread that made the throwing call.
If the timed_mutex is already locked by the current thread, calling this function causes a deadlock (undefined behavior): on certain library implementations, this causes the function to fail.

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
timed_mutex::try_lock
Lock timed mutex if not locked (public member function)
timed_mutex::try_lock_for
Try to lock for time span (public member function)
timed_mutex::try_lock_until
Try to lock until time point (public member function)
timed_mutex::unlock
Unlock timed 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