|
constexpr | mutex () noexcept |
| Construct mutex in its unlocked state.
|
|
constexpr | mutex (decltype(construct_locked)) noexcept |
| Construct mutex in its locked state.
|
|
| ~mutex () |
| Destruct mutex.
|
|
| mutex (const mutex &) noexcept=delete |
|
| mutex (mutex &&) noexcept=delete |
|
mutex & | operator= (const mutex &) noexcept=delete |
|
mutex & | operator= (mutex &&) noexcept=delete |
|
bool | try_lock () noexcept |
| Attempt to acquire the mutex whitout blocking or yielding.
|
|
constexpr lock_awaiter | lock () noexcept |
| Acquire the the mutex using co_await.
|
|
constexpr scoped_lock_awaiter | lock_scoped () noexcept |
| Acquire the the mutex using co_await and wrap it in a mutex_lock.
|
|
void | unlock () noexcept |
| Unlock the mutex.
|
|
bool | is_locked () const noexcept |
| Query if the lock is currently locked.
|
|
A mutex with an asynchronous lock() operation.
Provides a asynchronous lock() method that can be awaited to allow usage in coroutines, without blocking others. Unlike std::mutex, this mutex is not tied to a particular thread. This is usefull if the coroutine gets suspended while holding the lock and is resumed on a different thread. The implementation is lock-free and does not throw.