C++ named requirements: SharedTimedLockable (since C++14)
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
C++ named requirements
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++17)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++17)
(C++20)
(C++20)
(C++20)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++14)
SharedTimedLockable
(C++14)
(C++11)
(C++11)
(C++17)
(C++14)
(C++20)
(C++20)
(C++23)
(C++23)
(C++23)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
The SharedTimedLockable requirements describe the characteristics of types that provide timed shared blocking semantics for execution agents (threads, processes, tasks).
[edit] Requirements
For type L
to be SharedTimedLockable, given
-
rel_time
, a value of a specialization of std::chrono::duration , and -
abs_time
, a value of a specialization of std::chrono::time_point ,
the following conditions have to be satisfied for an object m
of type L
:
Expression | Requires | Return value |
---|---|---|
m.try_lock_shared_for(rel_time) | Blocks for the provided duration rel_time or until a lock on m is acquired.
|
true if the lock was acquired, false otherwise. |
m.try_lock_shared_until(abs_time) | Blocks until the provided time point abs_time is reached or a lock on m is acquired.
|
true if the lock was acquired, false otherwise. |
[edit] Notes
The try_lock_shared_for
and try_lock_shared_until
member functions obtain a shared lock on m on success.
[edit] Standard library
The following standard library types satisfy SharedTimedLockable requirements:
(C++14)
(class) [edit]