From d38fde1f52b826ebb760236bdd5f23f69069ede9 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Thu, 21 Mar 2013 16:48:57 -0700 Subject: [PATCH] model: re-check pending future values whenever a promise is resolved This is the second part of the previous bugfix; now we must also allow stashed pending future values to be re-checked in case a promise has been resolved which now allows sending the value. --- model.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/model.cc b/model.cc index a9d90914..167ea947 100644 --- a/model.cc +++ b/model.cc @@ -1139,12 +1139,13 @@ bool ModelChecker::process_write(ModelAction *curr) } } - if (promises->empty()) { - for (unsigned int i = 0; i < futurevalues->size(); i++) { - struct PendingFutureValue pfv = (*futurevalues)[i]; + /* Check the pending future values */ + for (int i = (int)futurevalues->size() - 1; i >= 0; i--) { + struct PendingFutureValue pfv = (*futurevalues)[i]; + if (promises_may_allow(pfv.writer, pfv.reader)) { add_future_value(pfv.writer, pfv.reader); + futurevalues->erase(futurevalues->begin() + i); } - futurevalues->clear(); } mo_graph->commitChanges(); -- 2.34.1