mirror of
https://github.com/haproxy/haproxy.git
synced 2026-07-15 12:01:12 -04:00
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:
parent
c32bbd1ada
commit
5a00b11296
1 changed files with 2 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue