MADNESS
version 0.9
|
Scalable and fair condition variable (spins on local value) More...
#include <worldmutex.h>
Public Member Functions | |
ConditionVariable () | |
void | wait () const |
You should acquire the mutex before waiting. More... | |
void | signal () const |
You should acquire the mutex before signalling. More... | |
void | broadcast () const |
You should acquire the mutex before broadcasting. More... | |
virtual | ~ConditionVariable () |
Public Member Functions inherited from madness::Spinlock | |
Spinlock (int junk=0) | |
Make and initialize a spinlock ... initial state is unlocked. More... | |
bool | try_lock () const |
Try to acquire the spinlock ... return true on success, false on failure. More... | |
void | lock () const |
Acquire the spinlock waiting if necessary. More... | |
void | unlock () const |
Free a spinlock owned by this thread. More... | |
virtual | ~Spinlock () |
Public Attributes | |
volatile int | back |
volatile int | front |
volatile bool *volatile | q [MAX_NTHREAD] |
Static Public Attributes | |
static const int | MAX_NTHREAD = 64 |
Scalable and fair condition variable (spins on local value)
|
inline |
|
inlinevirtual |
|
inline |
You should acquire the mutex before broadcasting.
References signal().
|
inline |
You should acquire the mutex before signalling.
References madness::f, and front.
Referenced by broadcast().
|
inline |
You should acquire the mutex before waiting.
References b(), back, madness::cpu_relax(), madness::Spinlock::lock(), TAU_START, TAU_STOP, and madness::Spinlock::unlock().
|
mutable |
Referenced by wait().
|
mutable |
Referenced by signal().
|
static |
|
mutable |