|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TheTimedLockable requirements describe the characteristics of types that provide timed exclusive blocking semantics for execution agents (threads, processes, tasks).
Contents |
For typeL to beTimedLockable, given
rel_time, a value of a specialization ofstd::chrono::duration, andabs_time, a value of a specialization ofstd::chrono::time_point,the following conditions have to be satisfied for an objectm of typeL:
| Expression | Effects | Return value |
|---|---|---|
| m.try_lock_for(rel_time) | Blocks for the provided durationrel_time or until a lock onm is acquired. | true if the lock was acquired,false otherwise. |
| m.try_lock_until(abs_time) | Blocks until the provided time pointabs_time is reached or a lock onm is acquired. | true if the lock was acquired,false otherwise. |
Thetry_lock_for andtry_lock_until member functions obtain a non-shared lock onm on success.
The following standard library types satisfyTimedLockable:
(C++11) | provides mutual exclusion facility which implements locking with a timeout (class)[edit] |
(C++11) | provides mutual exclusion facility which can be locked recursively by the same thread and implements locking with a timeout (class)[edit] |
(C++14) | provides shared mutual exclusion facility and implements locking with a timeout (class)[edit] |