31template<
class Acquirable>
class Guard
36 : acquirable_(acquirable)
38 acquirable_.acquire();
43 acquirable_.release();
47 Acquirable & acquirable_;
Performs automatic acquisition and release of a synchronization object.
~Guard()
Releases the synchronization object upon destruction.
Guard(Acquirable &acquirable)
Acquires the given synchronization object upon initialization.
Guard< Mutex > MutexGuard
Guard< Semaphore > SemaphoreGuard