From 19bdf2428d171bc126d3571a2c69382654c7e384 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Fri, 17 Aug 2018 13:36:08 +0200 Subject: [PATCH] MINOR: tasks: Don't special-case when nbthreads == 1 Instead of checking if nbthreads == 1, just and thread_mask with all_threads_mask to know if we're supposed to add the task to the local or the global runqueue. --- src/task.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/task.c b/src/task.c index e357bc169..ce5b4f907 100644 --- a/src/task.c +++ b/src/task.c @@ -395,8 +395,7 @@ void process_runnable_tasks() state = HA_ATOMIC_AND(&t->state, ~TASK_RUNNING); if (state) #ifdef USE_THREAD - __task_wakeup(t, (t->thread_mask == tid_bit || - global.nbthread == 1) ? + __task_wakeup(t, ((t->thread_mask & all_threads_mask) == tid_bit) ? &rqueue_local[tid] : &rqueue); #else __task_wakeup(t, &rqueue_local[tid]);