Makefile: compile *.cc separately
[model-checker.git] / action.cc
index 34650c63927e03e471f9f17354fe39e786e46c77..6627714e1089b2ad16c85cc7ef4abe43d77b6f95 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -133,7 +133,18 @@ void ModelAction::read_from(ModelAction *act)
        value = act->value;
 }
 
-void ModelAction::print(void)
+/**
+ * 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
 {
        const char *type_str;
        switch (this->type) {