projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rename threads.h -> threads-model.h
[model-checker.git]
/
model.cc
diff --git
a/model.cc
b/model.cc
index e11dcf716939e1a13f1dd08f6b252ab60fef1b9b..5753c5c4e016e2a6b7433aeee60706e777505860 100644
(file)
--- a/
model.cc
+++ b/
model.cc
@@
-12,7
+12,7
@@
#include "promise.h"
#include "datarace.h"
#include "mutex.h"
#include "promise.h"
#include "datarace.h"
#include "mutex.h"
-#include "threads.h"
+#include "threads
-model
.h"
#define INITIAL_THREAD_ID 0
#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);
//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;
}
if (mo_graph->checkPromise(write, promise)) {
failed_promise = true;