RR Thread Pool
 All Classes Functions Typedefs Groups Pages
Public Member Functions | List of all members
Locker< Lockable > Class Template Reference

Convenient template class adapter to safely acquire and release lockable objects. More...

#include <Locker.h>

Public Member Functions

 Locker (Lockable &target)
 Creates a locker and acquires the passed target. More...
 
 Locker (Lockable *target)
 Creates a locker and acquires the passed target. More...
 
 ~Locker ()
 Destructor. More...
 

Detailed Description

template<typename Lockable>
class Locker< Lockable >

Convenient template class adapter to safely acquire and release lockable objects.

Template Parameters
LockableA class that implements methods lock() and unlock().
See Also

Constructor & Destructor Documentation

template<typename Lockable >
Locker< Lockable >::Locker ( Lockable &  target)
inline

Creates a locker and acquires the passed target.

Parameters
targetCall the method lock on the passed target.
template<typename Lockable >
Locker< Lockable >::Locker ( Lockable *  target)
inline

Creates a locker and acquires the passed target.

Parameters
targetCall the method lock on the passed target.
template<typename Lockable >
Locker< Lockable >::~Locker ( )
inline

Destructor.

Also calls the method unlock on the target previously passed to the constructor.


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