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 SGLOCK A lockable object.
18 inline SGGuard( SGLOCK& l ) : lock(l) { lock.lock(); }
21 * Destroy this object and unlock the locakable object.
23 inline ~SGGuard() { lock.unlock(); }
34 SGGuard(const SGLOCK&);
35 SGLOCK& operator= (const SGLOCK&);
38 #endif // SGGUARD_HXX_INCLUDED