wibble::sys::MutexLockT< Mutex > Class Template Reference

Acquire a mutex lock, RAII-style. More...

`#include <mutex.h>`

Collaboration diagram for wibble::sys::MutexLockT< Mutex >:
[legend]

## Public Member Functions

| MutexLockT (Mutex &m)
| ~MutexLockT ()
void | drop ()
void | reclaim ()
void | setYield (bool y)
void | checkYield ()

## Public Attributes

Mutex & | mutex
bool | locked
bool | yield

## Friends

class | Condition

## Detailed Description

### template<typename Mutex>
class wibble::sys::MutexLockT< Mutex >

Acquire a mutex lock, RAII-style.

## Constructor & Destructor Documentation

## MutexLockT()

template<typename Mutex >

wibble::sys::MutexLockT< Mutex >::MutexLockT | ( | Mutex & | m | ) |

inline

References wibble::sys::Mutex::lock(), wibble::sys::MutexLockT< Mutex >::locked, and wibble::sys::MutexLockT< Mutex >::mutex.

## ~MutexLockT()

template<typename Mutex >

wibble::sys::MutexLockT< Mutex >::~MutexLockT | ( |  | ) |

inline

References wibble::sys::MutexLockT< Mutex >::checkYield(), wibble::sys::MutexLockT< Mutex >::locked, wibble::sys::MutexLockT< Mutex >::mutex, and wibble::sys::Mutex::unlock().

## Member Function Documentation

## checkYield()

template<typename Mutex >

void wibble::sys::MutexLockT< Mutex >::checkYield | ( |  | ) |

inline

References wibble::sys::MutexLockT< Mutex >::yield.

Referenced by wibble::sys::MutexLockT< Mutex >::drop(), and wibble::sys::MutexLockT< Mutex >::~MutexLockT().

## drop()

template<typename Mutex >

void wibble::sys::MutexLockT< Mutex >::drop | ( |  | ) |

inline

References wibble::sys::MutexLockT< Mutex >::checkYield(), wibble::sys::MutexLockT< Mutex >::locked, wibble::sys::MutexLockT< Mutex >::mutex, and wibble::sys::Mutex::unlock().

## reclaim()

template<typename Mutex >

void wibble::sys::MutexLockT< Mutex >::reclaim | ( |  | ) |

inline

References wibble::sys::Mutex::lock(), wibble::sys::MutexLockT< Mutex >::locked, and wibble::sys::MutexLockT< Mutex >::mutex.

## setYield()

template<typename Mutex >

void wibble::sys::MutexLockT< Mutex >::setYield | ( | bool | y | ) |

inline

References wibble::sys::MutexLockT< Mutex >::yield.

## Friends And Related Function Documentation

## Condition

template<typename Mutex >

friend class Condition

friend

## Member Data Documentation

## locked

template<typename Mutex >

bool wibble::sys::MutexLockT< Mutex >::locked

Referenced by wibble::sys::MutexLockT< Mutex >::drop(), wibble::sys::MutexLockT< Mutex >::MutexLockT(), wibble::sys::MutexLockT< Mutex >::reclaim(), and wibble::sys::MutexLockT< Mutex >::~MutexLockT().

## mutex

template<typename Mutex >

Mutex& wibble::sys::MutexLockT< Mutex >::mutex

Referenced by wibble::sys::MutexLockT< Mutex >::drop(), wibble::sys::MutexLockT< Mutex >::MutexLockT(), wibble::sys::MutexLockT< Mutex >::reclaim(), wibble::sys::Condition::wait(), and wibble::sys::MutexLockT< Mutex >::~MutexLockT().

## yield

template<typename Mutex >

bool wibble::sys::MutexLockT< Mutex >::yield

Referenced by wibble::sys::MutexLockT< Mutex >::checkYield(), and wibble::sys::MutexLockT< Mutex >::setYield().

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

- mutex.h