![]() |
SG++-Doxygen-Documentation
|
Wrapper around MutexType which locks and unlocks upon construction/destruction. More...
#include <ScopedLock.hpp>
Public Member Functions | |
void | lockAgain () |
Re-locks the MutexType object, if unlocked. | |
ScopedLock (MutexType &m) | |
Constructor, locks the MutexType object. | |
void | unlock () |
Unlocks the MutexType object, if locked. | |
~ScopedLock () | |
Destructor, unlocks the MutexType object. | |
Protected Attributes | |
bool | locked |
whether the MutexType object is locked or not | |
MutexType & | mut |
underlying MutexType object | |
Wrapper around MutexType which locks and unlocks upon construction/destruction.
Adopted from http://bisqwit.iki.fi/story/howto/openmp/#Locks.
|
inlineexplicit |
Constructor, locks the MutexType object.
m | MutexType object to be wrapped |
References sgpp::base::MutexType::lock(), and mut.
|
inline |
|
inline |
Re-locks the MutexType object, if unlocked.
References sgpp::base::MutexType::lock(), locked, and mut.
|
inline |
Unlocks the MutexType object, if locked.
References locked, mut, and sgpp::base::MutexType::unlock().
Referenced by ~ScopedLock().
|
protected |
whether the MutexType object is locked or not
Referenced by lockAgain(), and unlock().
|
protected |
underlying MutexType object
Referenced by lockAgain(), ScopedLock(), and unlock().