YARP
Yet Another Robot Platform
yarp::os::AbstractLockGuard< Lockable > Class Template Reference

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...
 

Detailed Description

template<typename Lockable>
class yarp::os::AbstractLockGuard< Lockable >

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.

Deprecated:
since YARP 3.3

Definition at line 40 of file LockGuard.h.

Constructor & Destructor Documentation

◆ AbstractLockGuard()

template<typename Lockable >
yarp::os::AbstractLockGuard< Lockable >::AbstractLockGuard ( Lockable &  _lock)
explicit

Acquires ownership of the given mutex _mutex.

The behavior is undefined if _mutex is destroyed before the LockGuard object is.

Parameters
_mutexthe mutex which will be locked

Definition at line 71 of file LockGuard.h.

◆ ~AbstractLockGuard()

template<typename Lockable >
yarp::os::AbstractLockGuard< Lockable >::~AbstractLockGuard

destructs the LockGuard object, unlocks the underlying mutex

Definition at line 78 of file LockGuard.h.


The documentation for this class was generated from the following file: