mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-02 09:30:36 +00:00
BUILD: task/thread: fix single-threaded build of task.c
As expected, commit cde7902ac
("MEDIUM: tasks: improve fairness between
the local and global queues") broke the build with threads disabled,
and I forgot to rerun this test before committing. No backport is
needed.
This commit is contained in:
parent
8ef706502a
commit
3466e3cdcb
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user