mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-04 04:45:10 +02:00
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.
This commit is contained in:
committed by
practicalswift
parent
e022463a4b
commit
7e319d6393
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user