From 047ea1052d4f20c762b1b75099c8421932021b8a Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 25 Nov 2016 21:52:44 -0800 Subject: Make fImporting an std::atomic --- src/main.cpp | 2 +- src/main.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 05442057e4..d1ff8699e9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -68,7 +68,7 @@ int64_t nTimeBestReceived = 0; // Used only to inform the wallet of when we last CWaitableCriticalSection csBestBlock; CConditionVariable cvBlockChange; int nScriptCheckThreads = 0; -bool fImporting = false; +std::atomic_bool fImporting(false); bool fReindex = false; bool fTxIndex = false; bool fHavePruned = false; diff --git a/src/main.h b/src/main.h index 43c62f6de6..c98ed05726 100644 --- a/src/main.h +++ b/src/main.h @@ -165,7 +165,7 @@ extern uint64_t nLastBlockWeight; extern const std::string strMessageMagic; extern CWaitableCriticalSection csBestBlock; extern CConditionVariable cvBlockChange; -extern bool fImporting; +extern std::atomic_bool fImporting; extern bool fReindex; extern int nScriptCheckThreads; extern bool fTxIndex; -- cgit v1.2.3