Small changes; slightly faster than tsan11rec in jsbench now
[c11tester.git] / schedule.cc
index 31db9c8fd1c92184ad16f04be4640ca6a09214c4..9bd87077af6801811ce0cc05fa9e39df8f70cabc 100644 (file)
@@ -102,7 +102,14 @@ bool Scheduler::is_enabled(thread_id_t tid) const
  */
 bool Scheduler::is_sleep_set(const Thread *t) const
 {
-       return get_enabled(t) == THREAD_SLEEP_SET;
+       return is_sleep_set(t->get_id());
+}
+
+bool Scheduler::is_sleep_set(thread_id_t tid) const
+{
+       int id = id_to_int(tid);
+       ASSERT(id < enabled_len);
+       return enabled[id] == THREAD_SLEEP_SET;
 }
 
 /**