Thrill
0.1
|
Definition at line 25 of file onoff_switch.hpp.
#include <onoff_switch.hpp>
Public Member Functions | |
onoff_switch (bool flag=false) | |
construct switch More... | |
onoff_switch (const onoff_switch &)=delete | |
non-copyable: delete copy-constructor More... | |
bool | is_on () |
return true if switch is ON More... | |
void | off () |
turn switch OFF and notify one waiter More... | |
void | on () |
turn switch ON and notify one waiter More... | |
onoff_switch & | operator= (const onoff_switch &)=delete |
non-copyable: delete assignment operator More... | |
void | wait_for_off () |
wait for switch to turn OFF More... | |
void | wait_for_on () |
wait for switch to turn ON More... | |
Private Attributes | |
std::condition_variable | cond_ |
condition variable More... | |
std::mutex | mutex_ |
mutex for condition variable More... | |
bool | on_ |
the switch's state More... | |
|
inlineexplicit |
construct switch
Definition at line 38 of file onoff_switch.hpp.
References onoff_switch::operator=().
|
delete |
non-copyable: delete copy-constructor
|
inline |
return true if switch is ON
Definition at line 80 of file onoff_switch.hpp.
References onoff_switch::on_.
|
inline |
turn switch OFF and notify one waiter
Definition at line 56 of file onoff_switch.hpp.
|
inline |
turn switch ON and notify one waiter
Definition at line 48 of file onoff_switch.hpp.
Referenced by request_with_waiters::notify_waiters(), and set_switch_handler::operator()().
|
delete |
non-copyable: delete assignment operator
Referenced by onoff_switch::onoff_switch().
|
inline |
wait for switch to turn OFF
Definition at line 72 of file onoff_switch.hpp.
|
inline |
wait for switch to turn ON
Definition at line 64 of file onoff_switch.hpp.
Referenced by block_prefetcher< BlockType, BidIteratorType >::wait(), and foxxll::wait_any().
|
private |
condition variable
Definition at line 31 of file onoff_switch.hpp.
|
private |
mutex for condition variable
Definition at line 28 of file onoff_switch.hpp.
|
private |
the switch's state
Definition at line 34 of file onoff_switch.hpp.
Referenced by onoff_switch::is_on().