X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=mutex.cc;h=7fa0b589c8a4535a276c7f8f95eda76782bff554;hb=24dbae977ee0610d314b52a42a77f1a6f39752b3;hp=6ef297a594d6b897110e7663c1f3753f859e0c3a;hpb=f4d77c40b4029cdc18f4aaa5a4e01dfbcfca5f7b;p=model-checker.git diff --git a/mutex.cc b/mutex.cc index 6ef297a..7fa0b58 100644 --- a/mutex.cc +++ b/mutex.cc @@ -1,6 +1,7 @@ -#include "mutex.h" +#include + #include "model.h" -#include "threads.h" +#include "threads-model.h" #include "clockvector.h" namespace std { @@ -16,8 +17,7 @@ void mutex::lock() { } bool mutex::try_lock() { - model->switch_to_master(new ModelAction(ATOMIC_TRYLOCK, std::memory_order_seq_cst, this)); - return thread_current()->get_return_value(); + return model->switch_to_master(new ModelAction(ATOMIC_TRYLOCK, std::memory_order_seq_cst, this)); } void mutex::unlock() {