X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=action.cc;h=9f95727c8dcb63b27dfffc9782ab376a644d852b;hb=cb9b254332794ea63d0089b21b498f4a5301f08b;hp=34650c63927e03e471f9f17354fe39e786e46c77;hpb=e8bc4a0715ce1c86f3ff7d24179e1164bf3ee61b;p=model-checker.git diff --git a/action.cc b/action.cc index 34650c6..9f95727 100644 --- a/action.cc +++ b/action.cc @@ -133,6 +133,17 @@ void ModelAction::read_from(ModelAction *act) value = act->value; } +/** + * Check whether 'this' happens before act, according to the memory-model's + * happens before relation. This is checked via the ClockVector constructs. + * @return true if this action's thread has synchronized with act's thread + * since the execution of act, false otherwise. + */ +bool ModelAction::happens_before(ModelAction *act) +{ + return act->cv->synchronized_since(this); +} + void ModelAction::print(void) { const char *type_str;