changes
[model-checker.git] / action.cc
index 33c69656d7702d757cd90d44a5884fdef99e2864..33dbe75b22c7c3daf8f25f0b51f4a077d652e682 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -165,11 +165,22 @@ void ModelAction::create_cv(const ModelAction *parent)
 void ModelAction::read_from(const ModelAction *act)
 {
        ASSERT(cv);
-       if (act->is_release() && this->is_acquire())
+       if (act->is_release() && this->is_acquire()) {
+               synchronized(act);
                cv->merge(act->cv);
+       }
        reads_from = act;
 }
 
+
+/** Synchronize the current thread with the thread corresponding to
+ *  the ModelAction parameter. */
+
+void ModelAction::synchronized(const ModelAction *act) {
+       model->check_promises(cv, act->cv);
+       cv->merge(act->cv);
+}
+
 /**
  * Check whether 'this' happens before act, according to the memory-model's
  * happens before relation. This is checked via the ClockVector constructs.