aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2017-08-16 13:56:02 -0400
committerpracticalswift <practicalswift@users.noreply.github.com>2017-11-06 17:41:02 +0100
commit7e319d63932c40730ee66110cd8edd14a312f297 (patch)
tree7d9ef7dea62678881a4a295cdc6421d92ad9d91b /src/init.cpp
parente022463a4b238750476430d08b45bc9171791e6f (diff)
downloadbitcoin-7e319d63932c40730ee66110cd8edd14a312f297.tar.xz
Fix -Wthread-safety-analysis warnings. Change the sync.h primitives to std from boost.
Commit 1. This code was written by @TheBlueMatt in the following branch: * https://github.com/TheBlueMatt/bitcoin/commits/2017-08-test-10923 This commit message was written by me (@practicalswift) who also squashed @TheBlueMatt's commits into one and tried to summarize the changes made. Commit 2. Remove boost include. Remove boost mentions in comments.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 539adc23d5..9e3eb6b926 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -544,14 +544,14 @@ static void BlockNotifyCallback(bool initialSync, const CBlockIndex *pBlockIndex
}
static bool fHaveGenesis = false;
-static boost::mutex cs_GenesisWait;
+static CWaitableCriticalSection cs_GenesisWait;
static CConditionVariable condvar_GenesisWait;
static void BlockNotifyGenesisWait(bool, const CBlockIndex *pBlockIndex)
{
if (pBlockIndex != nullptr) {
{
- boost::unique_lock<boost::mutex> lock_GenesisWait(cs_GenesisWait);
+ WaitableLock lock_GenesisWait(cs_GenesisWait);
fHaveGenesis = true;
}
condvar_GenesisWait.notify_all();
@@ -1634,7 +1634,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
// Wait for genesis block to be processed
{
- boost::unique_lock<boost::mutex> lock(cs_GenesisWait);
+ WaitableLock lock(cs_GenesisWait);
while (!fHaveGenesis) {
condvar_GenesisWait.wait(lock);
}