This function name really doesn't describe what it does, in my opinion.
Update the name and add a description.
CycleNode *node = queue.back();
queue.pop_back();
- if (promise->increment_threads(node->getAction()->get_tid())) {
+ if (promise->eliminate_thread(node->getAction()->get_tid())) {
return true;
}
const ModelAction *act = promise->get_action();
if ((old_cv == NULL || !old_cv->synchronized_since(act)) &&
merge_cv->synchronized_since(act)) {
- if (promise->increment_threads(tid)) {
+ if (promise->eliminate_thread(tid)) {
//Promise has failed
priv->failed_promise = true;
return;
continue;
if (promise->get_write() && mo_graph->checkReachable(promise->get_write(), write)) {
- if (promise->increment_threads(tid)) {
+ if (promise->eliminate_thread(tid)) {
priv->failed_promise = true;
return;
}
#include "model.h"
#include "schedule.h"
-bool Promise::increment_threads(thread_id_t tid)
+/**
+ * Eliminate a thread which no longer can satisfy this promise. Once all
+ * enabled threads have been eliminated, this promise is unresolvable.
+ *
+ * @param tid The thread ID of the thread to eliminate
+ * @return True, if this elimination has invalidated the promise; false
+ * otherwise
+ */
+bool Promise::eliminate_thread(thread_id_t tid)
{
unsigned int id = id_to_int(tid);
if (id >= synced_thread.size())
read(act),
write(NULL)
{
- increment_threads(act->get_tid());
+ eliminate_thread(act->get_tid());
}
modelclock_t get_expiration() const { return expiration; }
ModelAction * get_action() const { return read; }
- bool increment_threads(thread_id_t tid);
+ bool eliminate_thread(thread_id_t tid);
bool has_sync_thread(thread_id_t tid) {
unsigned int id = id_to_int(tid);