YACLib
C++ library for concurrent tasks execution
|
#include <mutex.hpp>
Public Types | |
using | Base = detail::MutexImpl< FIFO, Batching > |
Public Member Functions | |
auto | TryGuard () noexcept |
Try to lock mutex and create UniqueGuard for it. | |
auto | Guard () noexcept |
Lock mutex and create UniqueGuard for it. | |
auto | GuardSticky () noexcept |
Lock mutex and create StickyGuard for it. | |
auto | Lock () noexcept |
Lock mutex. | |
auto | Unlock () noexcept |
The best way to unlock mutex, if you interested in batched critical section. | |
auto | UnlockOn (IExecutor &e) noexcept |
This method is an optimization for Unlock() and On() | |
bool | TryLock () noexcept |
Try to lock mutex return true if mutex was locked, false otherwise. | |
void | UnlockHere () noexcept |
The general way to unlock mutex, mainly for RAII. | |
Static Public Member Functions | |
template<typename To , typename From > | |
static auto & | Cast (From &from) noexcept |
Additional Inherited Members | |
Protected Member Functions inherited from yaclib::detail::MutexImpl< FIFO, Batching > | |
bool | TryLockAwait () noexcept |
bool | AwaitLock (BaseCore &curr) noexcept |
bool | TryUnlockAwait () noexcept |
YACLIB_INLINE bool | BatchingPossible () const noexcept |
void | UnlockHereAwait () noexcept |
auto | AwaitUnlock (BaseCore &curr) noexcept |
auto | AwaitUnlockOn (BaseCore &curr, IExecutor &executor) noexcept |
bool | TryLock () noexcept |
void | UnlockHere () noexcept |
Mutex for coroutines.
using yaclib::Mutex< Batching, FIFO >::Base = detail::MutexImpl<FIFO, Batching> |
|
inlinestaticnoexcept |
Definition at line 285 of file mutex.hpp.
References yaclib::MakeContract().
|
inlinenoexcept |
Lock mutex and create UniqueGuard for it.
|
inlinenoexcept |
Lock mutex and create StickyGuard for it.
|
inlinenoexcept |
|
inlinenoexcept |
Try to lock mutex and create UniqueGuard for it.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
This method is an optimization for Unlock() and On()
Use it instead of
Typical usage:
e | executor which will be used for code after unlock |
Definition at line 273 of file mutex.hpp.
References yaclib::MakeContract().