|
LLDB mainline
|
Bundles a value of type T with the Mutex that guards it. More...
#include <Locked.h>
Public Member Functions | |
| Guarded ()=default | |
| Guarded (T value) | |
| Guarded (const Guarded &)=delete | |
| Guarded & | operator= (const Guarded &)=delete |
| LockedPtr< T, Mutex > | Lock () |
| Exclusive (read/write) access to the value. | |
| SharedLockedPtr< T, Mutex > | LockShared () const |
| Shared (read-only) access to the value. | |
Private Attributes | |
| Mutex | m_mutex |
| T | m_value {} |
Bundles a value of type T with the Mutex that guards it.
This class prevents accidential use of a value without aquiring the lock and should be preferred over a member + mutex pair.
Mutex must satisfy Lockable when calling Lock() and SharedLockable when calling LockShared().
|
default |
Referenced by Guarded(), and operator=().
|
inlineexplicit |
|
delete |
References Guarded().
|
inline |
|
inline |
|
delete |
References Guarded().
|
mutableprivate |
Definition at line 195 of file Locked.h.
Referenced by Lock(), and LockShared().
|
private |
Definition at line 196 of file Locked.h.
Referenced by Guarded(), Lock(), and LockShared().