diff --git a/src/init.cpp b/src/init.cpp index d2176be92..518aaf46f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -124,7 +124,7 @@ static const char* FEE_ESTIMATES_FILENAME="fee_estimates.dat"; // shutdown thing. // -volatile bool fRequestShutdown = false; +std::atomic fRequestShutdown(false); void StartShutdown() { diff --git a/src/util.cpp b/src/util.cpp index bbaacef3e..a001de400 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -112,7 +112,7 @@ string strMiscWarning; bool fLogTimestamps = DEFAULT_LOGTIMESTAMPS; bool fLogTimeMicros = DEFAULT_LOGTIMEMICROS; bool fLogIPs = DEFAULT_LOGIPS; -volatile bool fReopenDebugLog = false; +std::atomic fReopenDebugLog(false); CTranslationInterface translationInterface; /** Init OpenSSL library multithreading support */ diff --git a/src/util.h b/src/util.h index 2c5e93bcc..440cb54da 100644 --- a/src/util.h +++ b/src/util.h @@ -18,6 +18,7 @@ #include "tinyformat.h" #include "utiltime.h" +#include #include #include #include @@ -59,7 +60,7 @@ extern std::string strMiscWarning; extern bool fLogTimestamps; extern bool fLogTimeMicros; extern bool fLogIPs; -extern volatile bool fReopenDebugLog; +extern std::atomic fReopenDebugLog; extern CTranslationInterface translationInterface; extern const char * const BITCOIN_CONF_FILENAME;