MADNESS 0.10.1
|
Spinlock using pthread spinlock operations. More...
#include <worldmutex.h>
Public Member Functions | |
Spinlock (int junk=0) | |
Make and initialize a spinlock ... initial state is unlocked. | |
virtual | ~Spinlock () |
void | lock () const |
Acquire the spinlock waiting if necessary. | |
bool | try_lock () const |
Try to acquire the spinlock ... return true on success, false on failure. | |
void | unlock () const |
Free a spinlock owned by this thread. | |
Private Member Functions | |
Spinlock (const Spinlock &) | |
Copy constructor is forbidden. | |
void | operator= (const Spinlock &) |
Assignment is forbidden. | |
Private Attributes | |
pthread_spinlock_t | spinlock |
Spinlock using pthread spinlock operations.
|
private |
Copy constructor is forbidden.
|
inline |
Make and initialize a spinlock ... initial state is unlocked.
References spinlock.
|
inlinevirtual |
References spinlock.
|
inline |
Acquire the spinlock waiting if necessary.
References MADNESS_EXCEPTION, madness::detail::print_mutex_error(), and spinlock.
Referenced by madness::Hash_private::bin< keyT, valueT >::clear(), madness::Hash_private::bin< keyT, valueT >::del(), madness::Hash_private::bin< keyT, valueT >::find(), madness::Hash_private::bin< keyT, valueT >::insert(), madness::MutexFair::lock(), madness::WorldObject< Derived >::process_pending(), madness::MutexFair::try_lock(), madness::MutexFair::unlock(), and madness::ConditionVariable::wait().
|
private |
Assignment is forbidden.
|
inline |
Try to acquire the spinlock ... return true on success, false on failure.
References spinlock.
Referenced by madness::MutexReaderWriter::lock().
|
inline |
Free a spinlock owned by this thread.
References MADNESS_EXCEPTION, madness::detail::print_mutex_error(), and spinlock.
Referenced by madness::Hash_private::bin< keyT, valueT >::clear(), madness::Hash_private::bin< keyT, valueT >::del(), madness::Hash_private::bin< keyT, valueT >::find(), madness::Hash_private::bin< keyT, valueT >::insert(), madness::MutexFair::lock(), madness::WorldObject< Derived >::process_pending(), madness::MutexFair::try_lock(), madness::MutexFair::unlock(), and madness::ConditionVariable::wait().
|
mutableprivate |
Referenced by Spinlock(), ~Spinlock(), lock(), try_lock(), and unlock().