aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-11-07 10:29:21 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2017-11-07 10:36:58 -0800
commitef8a634358848847e006c43ce621bc17a612fd1f (patch)
tree01b37585163aa41fd152ec887f952e17e550e682 /src/init.cpp
parent70fec9e36bcd1a3d93df019be084aaf89cecd7d7 (diff)
parent76ea17c7964c15dd90e10c2c257cdeb5847b3d69 (diff)
downloadbitcoin-ef8a634358848847e006c43ce621bc17a612fd1f.tar.xz
Merge #10866: Fix -Wthread-safety-analysis warnings. Compile with -Wthread-safety-analysis if available.
76ea17c79 Add mutex requirement for AddToCompactExtraTransactions(…) (practicalswift) 4616c825a Use -Wthread-safety-analysis if available (+ -Werror=thread-safety-analysis if --enable-werror) (practicalswift) 7e319d639 Fix -Wthread-safety-analysis warnings. Change the sync.h primitives to std from boost. (Matt Corallo) Pull request description: * Add mutex requirement for `AddToCompactExtraTransactions(…)`. * Use `-Wthread-safety-analysis` if available. * Rebased on top of https://github.com/TheBlueMatt/bitcoin/commits/2017-08-test-10923 - now includes: Fix -Wthread-safety-analysis warnings. Change the sync.h primitives to std from boost. Tree-SHA512: fb7365f85daa2741c276a1c899228181a8d46af51db7fbbdffceeaff121a3eb2ab74d7c8bf5e7de879bcc5042d00d24cb4649c312d51caba45a3f6135fd8b38f
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 e57ea0f436..ddac606a39 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();
@@ -1630,7 +1630,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);
}