A convenience object for lexical scope based synchronization. More...
#include <ScopedLock.h++>
Public Member Functions | |
| ScopedLock (Lock &lock) throw () | |
| Construct a new Scopedock for the given Lock. | |
| ~ScopedLock () throw () | |
| Destructor. | |
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 }
| ScopedLock | ( | Lock & | lock | ) | throw () [inline] |
| ~ScopedLock | ( | ) | throw () [inline] |
Destructor.
Unlocks the Lock.
1.6.3