We were comparing the boolean (is_enabled(t)) to an enum
(THREAD_DISABLED). This happened to work as we wanted to because
THREAD_DISABLED == 0 == false. But that's not really what I meant...
Anyway, this uses a proper ModelChecker::is_enabled(tid) interface.
{
bool blocking_threads = false;
for (unsigned int i = 0; i < get_num_threads(); i++) {
- Thread *t = get_thread(int_to_id(i));
- if (scheduler->is_enabled(t) != THREAD_DISABLED)
+ thread_id_t tid = int_to_id(i);
+ if (is_enabled(tid))
return false;
- else if (!t->is_model_thread() && t->get_pending())
+ Thread *t = get_thread(tid);
+ if (!t->is_model_thread() && t->get_pending())
blocking_threads = true;
}
return blocking_threads;