]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tasks: Make global_tasks_mask volatile.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 26 Jul 2018 16:53:28 +0000 (18:53 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 26 Jul 2018 17:09:50 +0000 (19:09 +0200)
In order to make sure modifications are noticed by other threads when needed,
make global_tasks_mask volatile.

src/task.c

index e1692015722a0cdfb9c880b07f51ef5aa16639fa..672730b8ec3a2919efe990b76bef1edae8897112 100644 (file)
@@ -34,7 +34,7 @@ struct pool_head *pool_head_notification;
 
 unsigned int nb_tasks = 0;
 volatile unsigned long active_tasks_mask = 0; /* Mask of threads with active tasks */
-unsigned long global_tasks_mask = 0; /* Mask of threads with tasks in the global runqueue */
+volatile unsigned long global_tasks_mask = 0; /* Mask of threads with tasks in the global runqueue */
 unsigned int tasks_run_queue = 0;
 unsigned int tasks_run_queue_cur = 0;    /* copy of the run queue size */
 unsigned int nb_tasks_cur = 0;     /* copy of the tasks count */