]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: task: fix build at -O0 with threads disabled
authorWilly Tarreau <w@1wt.eu>
Tue, 9 Mar 2021 08:59:50 +0000 (09:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 9 Mar 2021 09:01:01 +0000 (10:01 +0100)
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

index bc8ecf4cfdf918a1c577ad8855f9dd42a55e58e4..602c6cef52f9c1d1e6207a764b6a4d59973210b4 100644 (file)
@@ -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;
        }