4 #include "clockvector.h"
9 thread_id_t tid=thread_current()->get_id();
11 state.alloc_clock=model->get_cv(tid)->getClock(tid);
15 model->switch_to_master(new ModelAction(ATOMIC_LOCK, std::memory_order_seq_cst, this));
18 bool mutex::try_lock() {
19 model->switch_to_master(new ModelAction(ATOMIC_TRYLOCK, std::memory_order_seq_cst, this));
20 return thread_current()->get_return_value();
23 void mutex::unlock() {
24 model->switch_to_master(new ModelAction(ATOMIC_UNLOCK, std::memory_order_seq_cst, this));