From: Willy Tarreau Date: Tue, 9 Mar 2021 08:59:50 +0000 (+0100) Subject: BUILD: task: fix build at -O0 with threads disabled X-Git-Tag: v2.4-dev12~68 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b7e0c633e89fabf04966f4ac14d5902d96b8c7a6;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/task.c b/src/task.c index bc8ecf4cfd..602c6cef52 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; }