This class is a mutex wrapper that provides a convenient RAII-style mechanism for owning a mutex for the duration of a scoped block. More...
#include <yarp/os/LockGuard.h>
Public Member Functions | |
AbstractLockGuard (Lockable &_lock) | |
Acquires ownership of the given mutex _mutex. More... | |
~AbstractLockGuard () | |
destructs the LockGuard object, unlocks the underlying mutex More... | |
This class is a mutex wrapper that provides a convenient RAII-style mechanism for owning a mutex for the duration of a scoped block.
When a LockGuard object is created, it attempts to take ownership of the mutex it is given. When control leaves the scope in which the LockGuard object was created, the LockGuard is destructed and the mutex is released. The lock_guard class is non-copyable.
Definition at line 40 of file LockGuard.h.
|
explicit |
Acquires ownership of the given mutex _mutex.
The behavior is undefined if _mutex is destroyed before the LockGuard object is.
_mutex | the mutex which will be locked |
Definition at line 71 of file LockGuard.h.
yarp::os::AbstractLockGuard< Lockable >::~AbstractLockGuard |
destructs the LockGuard object, unlocks the underlying mutex
Definition at line 78 of file LockGuard.h.