|
awaiter | lock () const noexcept |
| 在协程中加锁,如果不能立即获得锁,则阻塞当前协程。但不会阻塞当前线程。 更多...
|
|
awaiter | operator co_await () const noexcept |
| 在协程中加锁。 更多...
|
|
manual_awaiter | lock (adopt_manual_unlock_t manual_unlock_tag) const noexcept |
| 在协程中加锁,如果不能立即获得锁,则阻塞当前协程。但不会阻塞当前线程。 更多...
|
|
try_awaiter | try_lock () const noexcept |
| 尝试在协程中加锁。此操作无论成功与否都会立即返回,不会有协程切换。 更多...
|
|
unlock_awaiter | unlock () const noexcept |
| 在协程中解锁。此操作立即返回,不会有协程切换。 更多...
|
|
template<class _Rep , class _Period > |
timeout_awaiter | try_lock_for (const std::chrono::duration< _Rep, _Period > &dt) const noexcept |
| 在协程中尝试加锁,直到超时。如果不能立即获得锁,则阻塞当前协程。但不会阻塞当前线程。 更多...
|
|
template<class _Rep , class _Period > |
timeout_awaiter | try_lock_until (const std::chrono::time_point< _Rep, _Period > &tp) const noexcept |
| 在协程中尝试加锁,直到超时。如果不能立即获得锁,则阻塞当前协程。但不会阻塞当前线程。 更多...
|
|
void | lock (void *unique_address) const |
| 在非协程中加锁。如果不能立即获得锁,则反复尝试,直到获得锁。故会阻塞当前协程 更多...
|
|
bool | try_lock (void *unique_address) const |
| 尝试在非协程中加锁。此操作无论成功与否都会立即返回。 更多...
|
|
template<class _Rep , class _Period > |
bool | try_lock_for (const std::chrono::duration< _Rep, _Period > &dt, void *unique_address) |
| 尝试在非协程中加锁,直到超时。如果不能立即获得锁,则反复尝试,直到获得锁或超时。故会阻塞当前协程 更多...
|
|
template<class _Rep , class _Period > |
bool | try_lock_until (const std::chrono::time_point< _Rep, _Period > &tp, void *unique_address) |
| 尝试在非协程中加锁,直到超时。如果不能立即获得锁,则反复尝试,直到获得锁或超时。故会阻塞当前协程 更多...
|
|
void | unlock (void *unique_address) const |
| 在非协程中解锁。立即返回。由于立即返回,也可在协程中如此使用:mtx.unlock(root_state()) 更多...
|
|
| mutex_t (std::adopt_lock_t) noexcept |
| 构造一个无效的mutex_t。
|
|
|
template<class... _Mtxs> |
static future_t< batch_unlock_t< _Mtxs... > > | lock (_Mtxs &... mtxs) |
| 在协程中,无死锁的批量加锁。不会阻塞当前线程。直到获得所有锁之前,会阻塞当前协程。 更多...
|
|
template<class... _Mtxs> |
static future_t | lock (adopt_manual_unlock_t manual_unlock_tag, _Mtxs &... mtxs) |
| 在协程中,无死锁的批量加锁。不会阻塞当前线程。直到获得所有锁之前,会阻塞当前协程。 更多...
|
|
template<class... _Mtxs> |
static future_t | unlock (_Mtxs &... mtxs) |
| 在协程中批量解锁。如果可能,使用unlock(root_state(), mtxs...)来替代。 更多...
|
|
template<class... _Mtxs> |
static batch_unlock_t< _Mtxs... > | lock (void *unique_address, _Mtxs &... mtxs) |
| 在非协程中,无死锁的批量加锁。会阻塞当前线程,直到获得所有锁为止。 更多...
|
|
template<class... _Mtxs> |
static void | lock (adopt_manual_unlock_t manual_unlock_tag, void *unique_address, _Mtxs &... mtxs) |
| 在非协程中,无死锁的批量加锁。会阻塞当前线程,直到获得所有锁为止。 更多...
|
|
template<class... _Mtxs> |
static void | unlock (void *unique_address, _Mtxs &... mtxs) |
| 在非协程中批量解锁。立即返回。由于立即返回,也可在协程中如此使用:unlock(root_state(), mtxs...) 更多...
|
|
支持递归的锁。
锁被本协程所在的跟协程所拥有。支持在跟协程下的所有协程里递归加锁。