A Barrier to block execution of code.
More...
#include <Barrier.h>
|
class | ScopedActivator |
| A helper class to put up a barrier when entering a scope and take it down when leaving the scope. More...
|
|
A Barrier to block execution of code.
Definition at line 44 of file Barrier.h.
Hypertable::Barrier::Barrier |
( |
| ) |
|
|
inline |
void Hypertable::Barrier::enter |
( |
| ) |
|
|
inline |
Enters the critical section.
If the barrier is "up" then this thread will wait till the barrier is "down" again, then it can continue execution.
Definition at line 52 of file Barrier.h.
void Hypertable::Barrier::exit |
( |
| ) |
|
|
inline |
Leaves the critical section; will wake up/notify waiting threads if necessary.
Definition at line 61 of file Barrier.h.
void Hypertable::Barrier::put_up |
( |
| ) |
|
|
inline |
"Puts" the barrier "up".
If any threads are currently executing the blocked code then this thread will wait till they are done. Otherwise only the current thread can execute the code.
Definition at line 73 of file Barrier.h.
void Hypertable::Barrier::take_down |
( |
| ) |
|
|
inline |
"Takes" the barrier "down"; all threads waiting in enter() are allowed to continue.
Definition at line 83 of file Barrier.h.
uint32_t Hypertable::Barrier::m_counter {} |
|
private |
bool Hypertable::Barrier::m_hold |
|
private |
True if the barrier is up.
Definition at line 124 of file Barrier.h.
std::mutex Hypertable::Barrier::m_mutex |
|
private |
Mutex to lock access to the members and conditions.
Definition at line 115 of file Barrier.h.
std::condition_variable Hypertable::Barrier::m_quiesced_cond |
|
private |
Condition to wait for to take the barrier down.
Definition at line 121 of file Barrier.h.
std::condition_variable Hypertable::Barrier::m_unblocked_cond |
|
private |
Condition to wait for when barrier is up.
Definition at line 118 of file Barrier.h.
The documentation for this class was generated from the following file:
- /home/doug/src/hypertable/src/cc/Common/Barrier.h