]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tasks: Use __task_get_current_owner() in task_kill.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 11 Jun 2026 14:20:29 +0000 (16:20 +0200)
committerOlivier Houchard <cognet@ci0.org>
Fri, 12 Jun 2026 09:49:09 +0000 (11:49 +0200)
In task_kill(), to know which thread to send the task to, use
__task_get_current_owner(), in preparation for future changes.

src/task.c

index 0d866ddd9788ab16f68dc5a42c447d08f73fdfb7..80f3368033752da9a8883107142e16b06a08204f 100644 (file)
@@ -86,7 +86,9 @@ void task_kill(struct task *t)
                         * Note: that's a task so it must be accounted for as such. Pick
                         * the task's first thread for the job.
                         */
-                       thr = t->tid >= 0 ? t->tid : tid;
+                       thr = __task_get_current_owner(t->tid);
+                       if (thr == -1)
+                               thr = tid;
 
                        /* Beware: tasks that have never run don't have their ->list empty yet! */
                        MT_LIST_APPEND(&ha_thread_ctx[thr].shared_tasklet_list,