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.
This commit is contained in:
Willy Tarreau 2021-03-09 09:59:50 +01:00
parent 56c176a780
commit b7e0c633e8

View 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;
}