Skip to content

Commit

Permalink
Use std::atomic for fRequestShutdown and fReopenDebugLog
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa authored and bitcartel committed Oct 25, 2016
1 parent 3f97a53 commit bf67364
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ CClientUIInterface uiInterface; // Declared but not defined in ui_interface.h
// shutdown thing.
//

volatile sig_atomic_t fRequestShutdown = false;
std::atomic<bool> fRequestShutdown(false);

void StartShutdown()
{
Expand Down
2 changes: 1 addition & 1 deletion src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ string strMiscWarning;
bool fLogTimestamps = DEFAULT_LOGTIMESTAMPS;
bool fLogTimeMicros = DEFAULT_LOGTIMEMICROS;
bool fLogIPs = DEFAULT_LOGIPS;
volatile sig_atomic_t fReopenDebugLog = false;
std::atomic<bool> fReopenDebugLog(false);
CTranslationInterface translationInterface;

/** Init OpenSSL library multithreading support */
Expand Down
7 changes: 2 additions & 5 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "tinyformat.h"
#include "utiltime.h"

#include <atomic>
#include <exception>
#include <map>
#include <stdint.h>
Expand All @@ -28,10 +29,6 @@
#include <boost/signals2/signal.hpp>
#include <boost/thread/exceptions.hpp>

#ifndef WIN32
#include <signal.h>
#endif

static const bool DEFAULT_LOGTIMEMICROS = false;
static const bool DEFAULT_LOGIPS = false;
static const bool DEFAULT_LOGTIMESTAMPS = true;
Expand All @@ -53,7 +50,7 @@ extern bool fServer;
extern std::string strMiscWarning;
extern bool fLogTimestamps;
extern bool fLogIPs;
extern volatile sig_atomic_t fReopenDebugLog;
extern std::atomic<bool> fReopenDebugLog;
extern CTranslationInterface translationInterface;

/**
Expand Down

0 comments on commit bf67364

Please sign in to comment.