X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=action.cc;h=1a819eaf5584f1e97e88fca439104392c07b7f1b;hb=26d1dd1430da05b8da4b1250b299a620ecd52102;hp=3aeb7377e2b328fad8b24748744274ab1386e25d;hpb=d27984bb297795f4e9a4531e2730d8188a799e89;p=model-checker.git diff --git a/action.cc b/action.cc index 3aeb737..1a819ea 100644 --- a/action.cc +++ b/action.cc @@ -7,7 +7,7 @@ #include "action.h" #include "clockvector.h" #include "common.h" -#include "threads.h" +#include "threads-model.h" #include "nodestack.h" #define ACTION_INITIAL_CLOCK 0 @@ -111,6 +111,11 @@ bool ModelAction::is_write() const return type == ATOMIC_WRITE || type == ATOMIC_RMW || type == ATOMIC_INIT; } +bool ModelAction::could_be_write() const +{ + return is_write() || is_rmwr(); +} + bool ModelAction::is_rmwr() const { return type == ATOMIC_RMWR; @@ -217,11 +222,11 @@ bool ModelAction::could_synchronize_with(const ModelAction *act) const // Explore interleavings of seqcst writes to guarantee total order // of seq_cst operations that don't commute - if ((is_write() || act->is_write()) && is_seqcst() && act->is_seqcst()) + if ((could_be_write() || act->could_be_write()) && is_seqcst() && act->is_seqcst()) return true; // Explore synchronizing read/write pairs - if (is_read() && is_acquire() && act->is_write() && act->is_release()) + if (is_read() && is_acquire() && act->could_be_write() && act->is_release()) return true; // Otherwise handle by reads_from relation