X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=mutex.cc;h=7fa0b589c8a4535a276c7f8f95eda76782bff554;hb=3b08bb3248c8f63fc1c54da23da471cab0fe7239;hp=ce747351d09d328708d5410874f77eb40725df1e;hpb=e60d8c23d30a0dfe66b8426f7f2ecf576e812028;p=model-checker.git diff --git a/mutex.cc b/mutex.cc index ce74735..7fa0b58 100644 --- a/mutex.cc +++ b/mutex.cc @@ -1,4 +1,5 @@ -#include "mutex.h" +#include + #include "model.h" #include "threads-model.h" #include "clockvector.h" @@ -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() {