deal with looping due to bogus future value via promise expiration
[c11tester.git] / schedule.cc
index be4a92f739a1129bb2aa4bee50bb23ba0a3f8556..cbb4957a3e4a3865730679e8e816dfb51f636324 100644 (file)
@@ -32,17 +32,14 @@ void Scheduler::remove_thread(Thread *t)
 }
 
 /**
- * Force one Thread to wait on another Thread. The "join" Thread should
- * eventually wake up the waiting Thread via Scheduler::wake.
- * @param wait The Thread that should wait
- * @param join The Thread on which we are waiting.
+ * Prevent a Thread from being scheduled. The sleeping Thread should be
+ * re-awoken via Scheduler::wake.
+ * @param thread The Thread that should sleep
  */
-void Scheduler::wait(Thread *wait, Thread *join)
+void Scheduler::sleep(Thread *t)
 {
-       ASSERT(!join->is_complete());
-       remove_thread(wait);
-       join->push_wait_list(wait);
-       wait->set_state(THREAD_BLOCKED);
+       remove_thread(t);
+       t->set_state(THREAD_BLOCKED);
 }
 
 /**