From b7e0c633e89fabf04966f4ac14d5902d96b8c7a6 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 9 Mar 2021 09:59:50 +0100 Subject: [PATCH] BUILD: task: fix build at -O0 with threads disabled grq_total was incremented when picking tasks from the global run queue, but this variable was not defined with threads disabled, and the code was optimized away at -O2. No backport is needed. --- src/task.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/task.c b/src/task.c index bc8ecf4cf..602c6cef5 100644 --- a/src/task.c +++ b/src/task.c @@ -771,10 +771,12 @@ void process_runnable_tasks() if (lpicked + gpicked) { tt->tl_class_mask |= 1 << TL_NORMAL; _HA_ATOMIC_ADD(&tt->tasks_in_list, lpicked + gpicked); +#ifdef USE_THREAD if (gpicked) { _HA_ATOMIC_SUB(&grq_total, gpicked); _HA_ATOMIC_ADD(&tt->rq_total, gpicked); } +#endif activity[tid].tasksw += lpicked + gpicked; }