SG++-Doxygen-Documentation
|
Wrapper for OpenMP nested locks. More...
#include <MutexType.hpp>
Public Member Functions | |
void | lock () |
Lock the MutexType. More... | |
MutexType () | |
Constructor. More... | |
MutexType (const MutexType &other) | |
Custom copy constructor to prevent copying the lock. More... | |
MutexType & | operator= (const MutexType &other) |
Custom assignment operator to prevent copying the lock. More... | |
void | unlock () |
Unlock the MutexType. More... | |
~MutexType () | |
Destructor. More... | |
Protected Attributes | |
omp_nest_lock_t | _lock |
OpenMP lock. More... | |
Wrapper for OpenMP nested locks.
Once locked, other threads block when trying to lock the same MutexType. However, the MutexType can be locked multiple times by the same thread without blocking. In this case, it has to be unlocked the same number of times to let the other threads continuing execution.
Adopted from http://bisqwit.iki.fi/story/howto/openmp/#Locks.
|
inline |
Constructor.
References _lock.
|
inline |
Custom copy constructor to prevent copying the lock.
other | object to be copied |
References _lock.
|
inline |
Destructor.
References _lock.
|
inline |
Lock the MutexType.
References _lock.
Referenced by sgpp::optimization::Printer::disableStatusPrinting(), sgpp::optimization::Printer::enableStatusPrinting(), sgpp::optimization::Printer::isStatusPrintingEnabled(), sgpp::optimization::ScopedLock::lockAgain(), sgpp::optimization::optimizer::MultiStart::optimize(), sgpp::optimization::Printer::printStatusBegin(), sgpp::optimization::Printer::printStatusEnd(), sgpp::optimization::Printer::printStatusUpdate(), and sgpp::optimization::ScopedLock::ScopedLock().
Custom assignment operator to prevent copying the lock.
other | object to be assigned to |
|
inline |
Unlock the MutexType.
References _lock.
Referenced by sgpp::optimization::optimizer::MultiStart::optimize(), and sgpp::optimization::ScopedLock::unlock().
|
protected |
OpenMP lock.
Referenced by lock(), MutexType(), unlock(), and ~MutexType().