]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tasks: Don't special-case when nbthreads == 1
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 17 Aug 2018 11:36:08 +0000 (13:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 17 Aug 2018 12:50:37 +0000 (14:50 +0200)
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

index e357bc169a72aa56045219c3b14e6f0aae4eaba5..ce5b4f907e2c1442d3c416064d71b64167b659e7 100644 (file)
@@ -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]);