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.
This commit is contained in:
Willy Tarreau 2026-06-25 10:48:44 +02:00
parent c32bbd1ada
commit 5a00b11296

View file

@ -395,6 +395,8 @@ void wake_expired_tasks()
if (new_tid == tid)
continue;
ASSUME(new_tid < MAX_THREADS);
if (ha_thread_ctx[new_tid].rq_total * 2 < th_ctx->rq_total) {
int cur_state;
do {