diff --git a/src/task.c b/src/task.c index 4e6a151e7..33c50c417 100644 --- a/src/task.c +++ b/src/task.c @@ -332,6 +332,7 @@ void process_runnable_tasks() while (task_per_thread[tid].task_list_size < max_processed) { if ((global_tasks_mask & tid_bit) && !grq) { +#ifdef USE_THREAD HA_SPIN_LOCK(TASK_RQ_LOCK, &rq_lock); grq = eb32sc_lookup_ge(&rqueue, rqueue_ticks - TIMER_LOOK_BACK, tid_bit); if (unlikely(!grq)) { @@ -341,6 +342,7 @@ void process_runnable_tasks() _HA_ATOMIC_AND(&global_tasks_mask, ~tid_bit); } } +#endif } /* If a global task is available for this thread, it's in grq @@ -361,6 +363,7 @@ void process_runnable_tasks() lrq = eb32sc_next(lrq, tid_bit); __task_unlink_rq(t); } +#ifdef USE_THREAD else { t = eb32sc_entry(grq, struct task, rq); grq = eb32sc_next(grq, tid_bit); @@ -373,6 +376,7 @@ void process_runnable_tasks() } } } +#endif /* Make sure nobody re-adds the task in the runqueue */ _HA_ATOMIC_OR(&t->state, TASK_RUNNING);