libcommonc++
0.7
|
A convenience object for lexical scope based synchronization. More...
#include <ScopedLock.h++>
Public Member Functions | |
ScopedLock (Lock &lock) | |
Construct a new Scopedock for the given Lock. More... | |
~ScopedLock () | |
Destructor. More... | |
A convenience object for lexical scope based synchronization.
ScopedLock locks a Lock in its constructor and unlocks it in its destructor.
A block of code can be conveniently protected by a ScopedLock by using the synchronized() macro, e.g.:
Mutex mutex;
synchronized(mutex) { // thread-exclusive code here }
|
inline |
|
inline |
Destructor.
Unlocks the Lock.