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