- for (int i = 0; i < enabled_len; i++) {
- thread_id_t tid = int_to_id(i);
- if (n->has_priority(tid)) {
- DEBUG("Node (tid %d) has priority\n", i);
- if (enabled[i] != THREAD_DISABLED)
- have_enabled_thread_with_priority = true;
+ bool have_enabled_thread_with_priority = false;
+ if (model->params.fairwindow != 0) {
+ for (int i = 0; i < enabled_len; i++) {
+ thread_id_t tid = int_to_id(i);
+ if (n->has_priority(tid)) {
+ DEBUG("Node (tid %d) has priority\n", i);
+ if (enabled[i] != THREAD_DISABLED)
+ have_enabled_thread_with_priority = true;
+ }