|
solarpowerlog trunk
|
#include <CMutexHelper.h>
Public Member Functions | |
| CMutexAutoLock (boost::mutex *mutex) | |
| virtual | ~CMutexAutoLock () |
Mutex Wrapper
The library makes you keeping track when you entered the Mutex. This generates the problem, that if the function is left without considering the lock, the lock remains forever.
This class helps in this case: Just create an object of it, passing the "this" pointer to the constructor (assuming your class is derived from Mutex) and enjoy the lock.
The lock is automatically destroyed on destrucing the object.
Definition at line 54 of file CMutexHelper.h.
| CMutexAutoLock::CMutexAutoLock | ( | boost::mutex * | mutex | ) |
Definition at line 41 of file CMutexHelper.cpp.
| CMutexAutoLock::~CMutexAutoLock | ( | ) | [virtual] |
Definition at line 46 of file CMutexHelper.cpp.