From 963ccbb3b8216418b78df36f174a73575446ef74 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 8 Jun 2019 20:55:42 -0700 Subject: [PATCH] move state dequeue prior to error check in explore() The bail out condition will soon need to ask about the state depth as well. Github: related to #131 "minimal trace mode" --- rumur/src/generate-model.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rumur/src/generate-model.cc b/rumur/src/generate-model.cc index 0be16ad5..7d3f2f9d 100644 --- a/rumur/src/generate-model.cc +++ b/rumur/src/generate-model.cc @@ -797,14 +797,14 @@ void generate_model(std::ostream &out, const Model &m) { << "\n" << " for (;;) {\n" << "\n" - << " if (THREADS > 1 && __atomic_load_n(&error_count,\n" - << " __ATOMIC_SEQ_CST) >= MAX_ERRORS) {\n" - << " /* Another thread found an error. */\n" + << " const struct state *s = queue_dequeue(&queue_id);\n" + << " if (s == NULL) {\n" << " break;\n" << " }\n" << "\n" - << " const struct state *s = queue_dequeue(&queue_id);\n" - << " if (s == NULL) {\n" + << " if (THREADS > 1 && __atomic_load_n(&error_count,\n" + << " __ATOMIC_SEQ_CST) >= MAX_ERRORS) {\n" + << " /* Another thread found an error. */\n" << " break;\n" << " }\n" << "\n"