MINOR: sched: make sched->task_list_size atomic
We'll need to update it from foreign threads in order to throw killed
tasks and maintain correct accounting, so let's make it atomic.
diff --git a/src/task.c b/src/task.c
index 9f2e9d5..b65000b 100644
--- a/src/task.c
+++ b/src/task.c
@@ -405,7 +405,7 @@
/* OK then this is a regular task */
- task_per_thread[tid].task_list_size--;
+ _HA_ATOMIC_SUB(&task_per_thread[tid].task_list_size, 1);
if (unlikely(t->call_date)) {
uint64_t now_ns = now_mono_time();
@@ -585,7 +585,7 @@
/* And add it to the local task list */
tasklet_insert_into_tasklet_list(&tt->tasklets[TL_NORMAL], (struct tasklet *)t);
tt->tl_class_mask |= 1 << TL_NORMAL;
- tt->task_list_size++;
+ _HA_ATOMIC_ADD(&tt->task_list_size, 1);
activity[tid].tasksw++;
}