X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=action.cc;h=d4c6253caf20c23411c60ba350a91760c386e6fc;hb=refs%2Fheads%2Fmaster;hp=3d38e81c93d1111bf8828448fd5a52718c17eea6;hpb=6d27ffdd1fc1f816a8381c4c0553256598d62f4a;p=model-checker.git diff --git a/action.cc b/action.cc index 3d38e81..d4c6253 100644 --- a/action.cc +++ b/action.cc @@ -9,6 +9,7 @@ #include "common.h" #include "threads-model.h" #include "nodestack.h" +#include "wildcard.h" #define ACTION_INITIAL_CLOCK 0 @@ -34,6 +35,7 @@ ModelAction::ModelAction(action_type_t type, memory_order order, void *loc, uint64_t value, Thread *thread) : type(type), order(order), + original_order(order), location(loc), value(value), reads_from(NULL), @@ -192,6 +194,11 @@ bool ModelAction::is_initialization() const return type == ATOMIC_INIT; } +bool ModelAction::is_annotation() const +{ + return type == ATOMIC_ANNOTATION; +} + bool ModelAction::is_relaxed() const { return order == std::memory_order_relaxed; @@ -323,7 +330,7 @@ bool ModelAction::could_synchronize_with(const ModelAction *act) const return false; // Different locations commute - if (!same_var(act)) + if (!same_var(act) && !is_fence() && !act->is_fence()) return false; // Explore interleavings of seqcst writes/fences to guarantee total @@ -547,7 +554,8 @@ const char * ModelAction::get_type_str() const case ATOMIC_TRYLOCK: return "trylock"; case ATOMIC_WAIT: return "wait"; case ATOMIC_NOTIFY_ONE: return "notify one"; - case ATOMIC_NOTIFY_ALL: return "notify all"; + case ATOMIC_NOTIFY_ALL: return "notify all"; + case ATOMIC_ANNOTATION: return "annotation"; default: return "unknown type"; }; }