lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
|
Automatic lock management class that locks a given object on construction to be unlocked on destruction. More...
#include <scoped_lock.h>
Inherits noncopyable.
Public Types | |
enum | adopt_lock_t { adopt_lock } |
Allows locked lockable objects to be adopted by a scoped lock object on construction. More... | |
typedef Lockable | lock_type |
Type of the lock managed by this class. | |
typedef Policy | policy_type |
Type of the locking policy used by this class. | |
Public Member Functions | |
LEAN_INLINE | scoped_lock (lock_type &lock) |
Locks the given object, to be unlocked on destruction. | |
LEAN_INLINE | scoped_lock (lock_type &lock, adopt_lock_t) |
Assumes that the given object is already locked, obtaining lock ownership and unlocking the lockable object on destruction. | |
LEAN_INLINE | ~scoped_lock () |
Unlocks the lock object managed by this class. | |
LEAN_INLINE lock_type & | get (void) |
Gets the lock object managed by this class. | |
LEAN_INLINE const lock_type & | get (void) const |
Gets the lock object managed by this class. |
Automatic lock management class that locks a given object on construction to be unlocked on destruction.
enum lean::smart::scoped_lock::adopt_lock_t |