]> git.kaiwu.me - haproxy.git/commit
BUILD: task: silence a build warning with threads disabled
authorWilly Tarreau <w@1wt.eu>
Thu, 25 Jun 2026 08:48:44 +0000 (10:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 25 Jun 2026 08:54:07 +0000 (10:54 +0200)
commit5a00b1129694191e2665eecb6ec1d1fb9e6b3e4d
treed9e6c8520df44331329f71ea576bc9f5e19237f5
parentc32bbd1ada2043884d3ef0565cb41c20345c0605
BUILD: task: silence a build warning with threads disabled

The compiler doesn't know that a random value based on global.nbthread
is necessarily smaller than MAX_THREADS, and when picking a random
thread number while single-threaded it complains that new_tid 1 is
out of bounds for the array. In fact all this is dead code in this
case.

Let's tell it about it to silence the warning.
src/task.c