3 #include <condition_variable>
8 condition_variable::condition_variable() {
12 condition_variable::~condition_variable() {
16 void condition_variable::notify_one() {
17 model->switch_to_master(new ModelAction(ATOMIC_NOTIFY_ONE, std::memory_order_seq_cst, this));
20 void condition_variable::notify_all() {
21 model->switch_to_master(new ModelAction(ATOMIC_NOTIFY_ALL, std::memory_order_seq_cst, this));
24 void condition_variable::wait(mutex& lock) {
25 model->switch_to_master(new ModelAction(ATOMIC_WAIT, std::memory_order_seq_cst, this, (uint64_t) &lock));
26 //relock as a second action