X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=model.cc;h=33fc4c3c38c3b5affc65bf360a833f5de8f8175e;hp=e5c8a55033289bf7393094c514d9e85658489342;hb=86ca0bf04682b0011466ab49abda78acbf024c54;hpb=5559fb2d19eacf3dbdbbb473a83b1832491ec212 diff --git a/model.cc b/model.cc index e5c8a550..33fc4c3c 100644 --- a/model.cc +++ b/model.cc @@ -294,6 +294,21 @@ bool ModelChecker::is_deadlocked() const return blocking_threads; } +/** + * Check if this is a complete execution. That is, have all thread completed + * execution (rather than exiting because sleep sets have forced a redundant + * execution). + * + * @return True if the execution is complete. + */ +bool ModelChecker::is_complete_execution() const +{ + for (unsigned int i = 0; i < get_num_threads(); i++) + if (is_enabled(int_to_id(i))) + return false; + return true; +} + /** * Queries the model-checker for more executions to explore and, if one * exists, resets the model-checker state to execute a new execution.