|
Lunchbox
1.10.0
|
A scoped mutex. More...
#include <scopedMutex.h>
Collaboration diagram for lunchbox::ScopedMutex< L, T >:Public Member Functions | |
| ScopedMutex (L *lock) | |
| Construct a new scoped mutex and set the given lock. More... | |
| ScopedMutex (L &lock) | |
| Construct a new scoped mutex and set the given lock. More... | |
| ScopedMutex (const ScopedMutex &rhs) | |
| Move lock from rhs to new mutex. More... | |
| ScopedMutex & | operator= (ScopedMutex &rhs) |
| Move lock from rhs to this mutex. More... | |
| template<typename LB > | |
| ScopedMutex (const LB &lockable) | |
| Construct a new scoped mutex for the given Lockable data structure. More... | |
| ~ScopedMutex () | |
| Destruct the scoped mutex and unset the mutex. More... | |
| void | leave () |
| Leave and unlock the mutex immediately. More... | |
A scoped mutex.
The mutex is automatically set upon creation, and released when the scoped mutex is destroyed, e.g., when the scope is left. The scoped mutex does nothing if a 0 pointer for the lock is passed.
Definition at line 59 of file scopedMutex.h.
|
inlineexplicit |
Construct a new scoped mutex and set the given lock.
Providing no Lock (0) is allowed, in which case the scoped mutex does nothing.
| lock | the mutex to set and unset, or 0. |
Definition at line 73 of file scopedMutex.h.
|
inlineexplicit |
Construct a new scoped mutex and set the given lock.
Definition at line 77 of file scopedMutex.h.
|
inline |
|
inlineexplicit |
Construct a new scoped mutex for the given Lockable data structure.
Definition at line 99 of file scopedMutex.h.
|
inline |
Destruct the scoped mutex and unset the mutex.
Definition at line 103 of file scopedMutex.h.
References lunchbox::ScopedMutex< L, T >::leave().
Here is the call graph for this function:
|
inline |
Leave and unlock the mutex immediately.
Definition at line 106 of file scopedMutex.h.
Referenced by lunchbox::ScopedMutex< L, T >::~ScopedMutex().
Here is the caller graph for this function:
|
inline |