When an atomic read action cannot read from a desired write, make this thread sleep...
[c11tester.git] / schedule.cc
index cb97d5bdba2efdbd95f44e1d4a355f9499140826..4a9752a761ee105472e79543ec0fd89fbdd2f114 100644 (file)
@@ -208,8 +208,8 @@ Thread * Scheduler::select_next_thread()
                        thread_list[avail_threads++] = i;
        }
 
-       if (avail_threads == 0)
-               return NULL;// No threads availablex
+       if (avail_threads == 0 && !execution->getFuzzer()->has_paused_threads())
+               return NULL;    // No threads available
 
        Thread * thread = execution->getFuzzer()->selectThread(thread_list, avail_threads);
        curr_thread_index = id_to_int(thread->get_id());