Base Framework
|
#include <base/concurrency/Lock.h>
Inherited by MutualExclusion, NISpinLock, ReadWriteLock, RecursiveMutualExclusion, and SpinLock.
Public Types | |
typedef ExclusiveSynchronize< Lock > | Sync |
Public Member Functions | |
Lock () noexcept | |
virtual void | exclusiveLock () const =0 |
virtual bool | tryExclusiveLock () const =0 |
virtual void | sharedLock () const =0 |
virtual bool | trySharedLock () const =0 |
virtual void | releaseLock () const =0 |
virtual | ~Lock () |
Lock interface.
This interface is implemented by classes used to synchronize contexts of execution by locking/unlocking.
|
inlinenoexcept |
Initializes lock.
|
virtual |
Destroy lock.
|
pure virtual |
Acquires an exclusive lock.
Implemented in RecursiveSpinLock, SpinLock, NISpinLock, ReadWriteLock, MutualExclusion, and RecursiveMutualExclusion.
|
pure virtual |
Releases the lock.
Implemented in RecursiveSpinLock, SpinLock, NISpinLock, MutualExclusion, RecursiveMutualExclusion, and ReadWriteLock.
|
pure virtual |
Acquires a shared lock. For some lock implementations this will acquire an exclusive lock.
Implemented in RecursiveSpinLock, SpinLock, NISpinLock, MutualExclusion, ReadWriteLock, and RecursiveMutualExclusion.
|
pure virtual |
Tries to acquire an exclusive lock.
Implemented in RecursiveSpinLock, SpinLock, NISpinLock, MutualExclusion, ReadWriteLock, and RecursiveMutualExclusion.
|
pure virtual |
Tries to acquire a shared lock. For some lock implementations this will acquire an exclusive lock.
Implemented in RecursiveSpinLock, SpinLock, NISpinLock, MutualExclusion, RecursiveMutualExclusion, and ReadWriteLock.