|
roo_threads
API Documentation for roo_threads
|
#include <mutex_api.h>
Public Types | |
| using | mutex_type = Mutex |
| Type of wrapped mutex. | |
Public Member Functions | |
| unique_lock () noexcept | |
| Constructs an empty lock not associated with any mutex. | |
| unique_lock (mutex_type &mutex) | |
| Acquires the given mutex. | |
| unique_lock (mutex_type &mutex, defer_lock_t) noexcept | |
| Associates with mutex but does not lock it. | |
| unique_lock (mutex_type &mutex, try_to_lock_t) | |
| Attempts to lock mutex without blocking. | |
| unique_lock (mutex_type &mutex, adopt_lock_t) noexcept | |
| Adopts an already-owned mutex. | |
| unique_lock (mutex_type &mutex, roo_time::Uptime tp) | |
| Attempts to lock until the specified time point. | |
| unique_lock (mutex_type &mutex, roo_time::Duration duration) | |
| Attempts to lock for the specified duration. | |
| ~unique_lock () | |
| Releases owned mutex if any. | |
| unique_lock (const unique_lock &)=delete | |
| unique_lock & | operator= (const unique_lock &)=delete |
| unique_lock (unique_lock &&lock) noexcept | |
| Move-constructs the lock. | |
| unique_lock & | operator= (unique_lock &&lock) noexcept |
| Move-assigns the lock. | |
| void | lock () |
| Acquires associated mutex. | |
| bool | try_lock () |
| Attempts to acquire associated mutex without blocking. | |
| bool | try_lock_until (roo_time::Uptime tp) |
| Attempts to acquire associated mutex before the given deadline. | |
| bool | try_lock_for (roo_time::Duration duration) |
| Attempts to acquire associated mutex for the given duration. | |
| void | unlock () |
| Releases associated mutex if owned. | |
| void | swap (unique_lock &other) noexcept |
| Swaps two locks. | |
| mutex_type * | release () noexcept |
| Disassociates lock from mutex without unlocking. | |
| bool | owns_lock () const noexcept |
| Returns whether this lock currently owns the mutex. | |
| operator bool () const noexcept | |
Boolean conversion equivalent to owns_lock(). | |
| mutex_type * | mutex () const noexcept |
Returns associated mutex pointer, or nullptr. | |
Definition at line 60 of file mutex_api.h.
Type of wrapped mutex.
Definition at line 63 of file mutex_api.h.
|
noexcept |
Constructs an empty lock not associated with any mutex.
|
explicit |
Acquires the given mutex.
| mutex | mutex to lock. |
|
noexcept |
Associates with mutex but does not lock it.
| mutex | mutex to associate with. |
| roo_threads::doc::unique_lock< Mutex >::unique_lock | ( | mutex_type & | mutex, |
| try_to_lock_t | |||
| ) |
Attempts to lock mutex without blocking.
| mutex | mutex to lock. |
|
noexcept |
Adopts an already-owned mutex.
| mutex | mutex already locked by caller. |
| roo_threads::doc::unique_lock< Mutex >::unique_lock | ( | mutex_type & | mutex, |
| roo_time::Uptime | tp | ||
| ) |
Attempts to lock until the specified time point.
| mutex | mutex to lock. |
| tp | absolute timeout point. |
| roo_threads::doc::unique_lock< Mutex >::unique_lock | ( | mutex_type & | mutex, |
| roo_time::Duration | duration | ||
| ) |
Attempts to lock for the specified duration.
| mutex | mutex to lock. |
| duration | relative timeout duration. |
Releases owned mutex if any.
|
delete |
|
noexcept |
Move-constructs the lock.
| void roo_threads::doc::unique_lock< Mutex >::lock | ( | ) |
Acquires associated mutex.
|
noexcept |
Returns associated mutex pointer, or nullptr.
|
explicitnoexcept |
Boolean conversion equivalent to owns_lock().
|
delete |
|
noexcept |
Move-assigns the lock.
|
noexcept |
Returns whether this lock currently owns the mutex.
|
noexcept |
Disassociates lock from mutex without unlocking.
|
noexcept |
Swaps two locks.
| bool roo_threads::doc::unique_lock< Mutex >::try_lock | ( | ) |
Attempts to acquire associated mutex without blocking.
| bool roo_threads::doc::unique_lock< Mutex >::try_lock_for | ( | roo_time::Duration | duration | ) |
Attempts to acquire associated mutex for the given duration.
| duration | relative timeout duration. |
| bool roo_threads::doc::unique_lock< Mutex >::try_lock_until | ( | roo_time::Uptime | tp | ) |
Attempts to acquire associated mutex before the given deadline.
| tp | absolute timeout point. |
| void roo_threads::doc::unique_lock< Mutex >::unlock | ( | ) |
Releases associated mutex if owned.