Skip to content

Commit

Permalink
Make some more variables atomic
Browse files Browse the repository at this point in the history
  • Loading branch information
dragorn committed Jul 28, 2018
1 parent e2ac876 commit 9b6dd67
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions globalregistry.h
Expand Up @@ -21,6 +21,7 @@

#include "config.h"

#include <atomic>
#include <unistd.h>
#include <memory>

Expand Down Expand Up @@ -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<int> 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<int> spindown;

// Did we receive a SIGWINCH that hasn't been dealt with yet?
bool winch;
Expand Down Expand Up @@ -238,7 +239,7 @@ class GlobalRegistry {

// Vector of child signals
pid_t sigchild_vec[1024];
unsigned int sigchild_vec_pos;
std::atomic<unsigned int> sigchild_vec_pos;

time_t start_time;
std::string servername;
Expand Down Expand Up @@ -327,7 +328,7 @@ class GlobalRegistry {
std::map<std::string, int> ext_name_map;
// External globals
std::map<int, std::shared_ptr<void> > ext_data_map;
int next_ext_ref;
std::atomic<int> next_ext_ref;

kis_recursive_timed_mutex lifetime_mutex;
std::vector<std::shared_ptr<LifetimeGlobal> > lifetime_vec;
Expand Down

0 comments on commit 9b6dd67

Please sign in to comment.