From: Brian Norris <banorris@uci.edu>
Date: Fri, 19 Apr 2013 21:29:29 +0000 (-0700)
Subject: execution: improve yield-blocking structure
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c76c1859f273b58b2fb3b39c8abca2159250905c;p=cdsspec-compiler.git

execution: improve yield-blocking structure

We should just check the yieldblock parameter within
ModelExecution::is_yieldblock().
---

diff --git a/execution.cc b/execution.cc
index 57ce6fe..e2b690e 100644
--- a/execution.cc
+++ b/execution.cc
@@ -266,6 +266,9 @@ bool ModelExecution::is_deadlocked() const
 
 bool ModelExecution::is_yieldblocked() const
 {
+	if (!params->yieldblock)
+		return false;
+
 	for (unsigned int i = 0; i < get_num_threads(); i++) {
 		thread_id_t tid = int_to_id(i);
 		Thread *t = get_thread(tid);
@@ -284,7 +287,7 @@ bool ModelExecution::is_yieldblocked() const
  */
 bool ModelExecution::is_complete_execution() const
 {
-	if (params->yieldblock && is_yieldblocked())
+	if (is_yieldblocked())
 		return false;
 	for (unsigned int i = 0; i < get_num_threads(); i++)
 		if (is_enabled(int_to_id(i)))
@@ -2674,7 +2677,7 @@ void ModelExecution::print_summary() const
 
 	model_print("Execution %d:", get_execution_number());
 	if (isfeasibleprefix()) {
-		if (params->yieldblock && is_yieldblocked())
+		if (is_yieldblocked())
 			model_print(" YIELD BLOCKED");
 		if (scheduler->all_threads_sleeping())
 			model_print(" SLEEP-SET REDUNDANT");