From 9bdbedb24f7c16c4941ec6b711fc8065e0cee9d3 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 5 Dec 2012 12:20:31 -0800 Subject: [PATCH] model: stop thread-trace search once edge is added Once an edge has been added from 'act' to the current thread (or the 'rf' thread), we don't need to continue to search for more edges. --- model.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/model.cc b/model.cc index b73d31a5..715a2584 100644 --- a/model.cc +++ b/model.cc @@ -1517,18 +1517,21 @@ bool ModelChecker::r_modification_order(ModelAction *curr, const ModelAction *rf *act < *last_sc_fence_thread_local) { mo_graph->addEdge(act, rf); added = true; + break; } /* C++, Section 29.3 statement 4 */ else if (act->is_seqcst() && last_sc_fence_local && *act < *last_sc_fence_local) { mo_graph->addEdge(act, rf); added = true; + break; } /* C++, Section 29.3 statement 6 */ else if (last_sc_fence_thread_before && *act < *last_sc_fence_thread_before) { mo_graph->addEdge(act, rf); added = true; + break; } } @@ -1705,6 +1708,7 @@ bool ModelChecker::w_modification_order(ModelAction *curr) *act < *last_sc_fence_thread_before) { mo_graph->addEdge(act, curr); added = true; + break; } /* -- 2.34.1