From: Willy Tarreau Date: Tue, 14 Jun 2022 09:00:46 +0000 (+0200) Subject: CLEANUP: hlua: check for at least 2 threads on a task X-Git-Tag: v2.7-dev1~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e35f03239d340735c6f2dbce094995c3fc63f258;p=thirdparty%2Fhaproxy.git CLEANUP: hlua: check for at least 2 threads on a task In 1.9-dev1, commit 5bc9972ed ("BUG/MINOR: lua/threads: Make lua's tasks sticky to the current thread") to detect unconfigured Lua tasks that could run on any thread, by comparing their thread mask with MAX_THREADS_MASK. The proper way to do it is to check for at least 2 threads in their mask in fact. This is more reliable and allows to get rid of MAX_THREADS_MASK there. --- diff --git a/src/hlua.c b/src/hlua.c index c2f0382830..33f054db57 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -8434,7 +8434,7 @@ struct task *hlua_process_task(struct task *task, void *context, unsigned int st struct hlua *hlua = context; enum hlua_exec status; - if (task->thread_mask == MAX_THREADS_MASK) + if (atleast2(task->thread_mask)) task_set_affinity(task, tid_bit); /* If it is the first call to the task, we must initialize the