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. | |
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:
|
strong |
|
nodiscardprotectedpure virtualnoexcept |
Checks if the guard currently holds the lock.
Implemented in original::multiLock< MUTEX >, and original::uniqueLock.
|
protectedpure virtual |
Locks the associated mutex(es)
sysError | if the lock operation fails |
Implemented in original::multiLock< MUTEX >, and original::uniqueLock.
|
protectedpure virtual |
Attempts to lock the associated mutex(es) without blocking.
sysError | if the operation fails |
Implemented in original::multiLock< MUTEX >, and original::uniqueLock.
|
protectedpure virtual |
Unlocks the associated mutex(es)
sysError | if the unlock operation fails |
Implemented in original::multiLock< MUTEX >, and original::uniqueLock.