![]() |
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. More... | |
| ScopedLock (MutexType &m) | |
| Constructor, locks the MutexType object. More... | |
| void | unlock () |
| Unlocks the MutexType object, if locked. More... | |
| ~ScopedLock () | |
| Destructor, unlocks the MutexType object. More... | |
Protected Attributes | |
| bool | locked |
| whether the MutexType object is locked or not More... | |
| MutexType & | mut |
| underlying MutexType object More... | |
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::optimization::MutexType::lock(), and mut.
|
inline |
|
inline |
Re-locks the MutexType object, if unlocked.
References sgpp::optimization::MutexType::lock(), locked, and mut.
|
inline |
Unlocks the MutexType object, if locked.
References locked, mut, and sgpp::optimization::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().