+/** Checks promises in response to change in ClockVector Threads. */
+
+void ModelChecker::check_promises(ClockVector *old_cv, ClockVector * merge_cv) {
+ for(unsigned int i=0;i<promises->size();i++) {
+ Promise * promise=(*promises)[i];
+ const ModelAction * act=promise->get_action();
+ if ((old_cv==NULL||!old_cv->synchronized_since(act))&&
+ merge_cv->synchronized_since(act)) {
+ //This thread is no longer able to send values back to satisfy the promise
+ int num_synchronized_threads=promise->increment_threads();
+ if (num_synchronized_threads==model->get_num_threads()) {
+ //Promise has failed
+ failed_promise = true;
+ return;
+ }
+ }
+ }
+}
+