From 9b6dd6725cc7711b1eb96cc35b41047f636256fd Mon Sep 17 00:00:00 2001 From: Mike Kershaw / Dragorn Date: Fri, 27 Jul 2018 23:00:23 -0400 Subject: [PATCH] Make some more variables atomic --- globalregistry.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/globalregistry.h b/globalregistry.h index a193e44a2..418d7afc9 100644 --- a/globalregistry.h +++ b/globalregistry.h @@ -21,6 +21,7 @@ #include "config.h" +#include #include #include @@ -205,10 +206,10 @@ class GlobalRegistry { // Fatal terminate condition, as soon as we detect this in the main code we // should initiate a shutdown - int fatal_condition; + std::atomic fatal_condition; // Are we in "spindown" mode, where we're giving components a little time // to clean up their business with pollables and shut down - int spindown; + std::atomic spindown; // Did we receive a SIGWINCH that hasn't been dealt with yet? bool winch; @@ -238,7 +239,7 @@ class GlobalRegistry { // Vector of child signals pid_t sigchild_vec[1024]; - unsigned int sigchild_vec_pos; + std::atomic sigchild_vec_pos; time_t start_time; std::string servername; @@ -327,7 +328,7 @@ class GlobalRegistry { std::map ext_name_map; // External globals std::map > ext_data_map; - int next_ext_ref; + std::atomic next_ext_ref; kis_recursive_timed_mutex lifetime_mutex; std::vector > lifetime_vec;