X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=model.cc;h=5753c5c4e016e2a6b7433aeee60706e777505860;hb=2e9b955070a194963ddb98a5cb3e16968323adec;hp=e11dcf716939e1a13f1dd08f6b252ab60fef1b9b;hpb=5d87d23f622d396fd2e1c94d61f901429c5f35ac;p=model-checker.git diff --git a/model.cc b/model.cc index e11dcf7..5753c5c 100644 --- a/model.cc +++ b/model.cc @@ -12,7 +12,7 @@ #include "promise.h" #include "datarace.h" #include "mutex.h" -#include "threads.h" +#include "threads-model.h" #define INITIAL_THREAD_ID 0 @@ -1779,6 +1779,11 @@ void ModelChecker::mo_check_promises(thread_id_t tid, const ModelAction *write) //do we have a pwrite for the promise, if not, set it if (promise->get_write() == NULL ) { promise->set_write(write); + //The pwrite cannot happen before the promise + if (write->happens_before(act) && (write != act)) { + failed_promise = true; + return; + } } if (mo_graph->checkPromise(write, promise)) { failed_promise = true;