X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=promise.cc;h=fdd45791f40657556f344c96b579ade87bc90736;hb=62dbff8dbca80ded5959e88ec9c177bef9108546;hp=e3b8d65e48d7c542bcf7e27da0473bb012a39057;hpb=3eb987279c382e0000de844728aceef2f360acf6;p=c11tester.git diff --git a/promise.cc b/promise.cc index e3b8d65e..fdd45791 100644 --- a/promise.cc +++ b/promise.cc @@ -74,11 +74,14 @@ void Promise::print() const */ bool Promise::has_failed() const { - for (unsigned int i = 0; i < available_thread.size(); i++) { - thread_id_t tid = int_to_id(i); - if (thread_is_available(tid) && model->is_enabled(tid)) - return false; - } - ASSERT(num_available_threads == 0); - return true; + return num_available_threads == 0; +} + +/** + * @param write A store which could satisfy this Promise + * @return True if the store can satisfy this Promise; false otherwise + */ +bool Promise::is_compatible(const ModelAction *write) const +{ + return thread_is_available(write->get_tid()); }