17 #ifndef STXXL_COMMON_ONOFF_SWITCH_HEADER
18 #define STXXL_COMMON_ONOFF_SWITCH_HEADER
85 #endif // !STXXL_COMMON_ONOFF_SWITCH_HEADER
onoff_switch(bool flag=false)
construct switch
void off()
turn switch OFF and notify one waiter
void unlock()
unlock mutex hold prematurely
void wait_for_off()
wait for switch to turn OFF
condition_variable m_cond
condition variable
Aquire a lock that's valid until the end of scope.
#define STXXL_BEGIN_NAMESPACE
mutex m_mutex
mutex for condition variable
bool is_on()
return true if switch is ON
void on()
turn switch ON and notify one waiter
void wait_for_on()
wait for switch to turn ON
bool m_on
the switch's state
#define STXXL_END_NAMESPACE