|
ORIGINAL
|
Abstract base class for lock guard implementations. More...
#include <mutex.h>


Public Types | |
| enum class | lockPolicy { MANUAL_LOCK , AUTO_LOCK , TRY_LOCK , ADOPT_LOCK } |
| Locking policies for guard construction. More... | |
Public Member Functions | |
| lockGuard ()=default | |
| Default constructor. | |
| lockGuard (const lockGuard &)=delete | |
| Deleted copy constructor. | |
| lockGuard & | operator= (const lockGuard &)=delete |
| Deleted copy assignment operator. | |
| virtual | ~lockGuard ()=default |
| Virtual destructor. | |
Static Public Attributes | |
| static constexpr auto | MANUAL_LOCK = lockPolicy::MANUAL_LOCK |
| Constant for manual lock policy. | |
| static constexpr auto | AUTO_LOCK = lockPolicy::AUTO_LOCK |
| Constant for automatic lock policy. | |
| static constexpr auto | TRY_LOCK = lockPolicy::TRY_LOCK |
| Constant for try-lock policy. | |
| static constexpr auto | ADOPT_LOCK = lockPolicy::ADOPT_LOCK |
| Constant for adopt lock policy. | |
Protected Member Functions | |
| virtual void | lock ()=0 |
| Locks the associated mutex(es) | |
| virtual bool | tryLock ()=0 |
| Attempts to lock the associated mutex(es) without blocking. | |
| virtual void | unlock ()=0 |
| Unlocks the associated mutex(es) | |
| virtual bool | isLocked () const noexcept=0 |
| Checks if the guard currently holds the lock. | |
Abstract base class for lock guard implementations.
Provides the interface for RAII-style lock management including:
Checks if the guard currently holds the lock.
Implemented in original::uniqueLock, and original::multiLock< MUTEX >.
Locks the associated mutex(es)
| sysError | if the lock operation fails |
Implemented in original::uniqueLock, and original::multiLock< MUTEX >.
Attempts to lock the associated mutex(es) without blocking.
| sysError | if the operation fails |
Implemented in original::uniqueLock, and original::multiLock< MUTEX >.
Unlocks the associated mutex(es)
| sysError | if the unlock operation fails |
Implemented in original::uniqueLock, and original::multiLock< MUTEX >.