1 #ifndef SGGUARD_HXX_INCLUDED
2 #define SGGUARD_HXX_INCLUDED 1
5 * A scoped locking utility.
6 * An SGGuard object locks its synchronization object during creation and
7 * automatically unlocks it when it goes out of scope.
15 * Create an SGGuard object and lock the passed lockable object.
16 * @param LOCK A lockable object.
18 inline SGGuard( LOCK& l ) : lock(l) { lock.lock(); }
21 * Destroy this object and unlock the locakable object.
23 inline ~SGGuard() { lock.unlock(); }
35 LOCK& operator= (const LOCK&);
38 #endif // SGGUARD_HXX_INCLUDED