Merge #14772: refactor: Convert comments to thread safety annotations

fa71eb5196 Convert comments to thread safety annotations (MarcoFalke)

Pull request description:

  Convert human-only-readable annotations to human-and-machine-readable annotations.

Tree-SHA512: 98a97b32b50e8ec816626ed853d56c9afb31065eb14f058cda8f22a16ddd2b0c02911f9e30478aa347f466891f972496d89a828eb6e4662fb712d7d9e7643d49
This commit is contained in:
MarcoFalke 2018-11-27 12:43:31 -05:00 committed by UdjinM6
parent 35bc42feb0
commit 8c64eec579
No known key found for this signature in database
GPG Key ID: 83592BD1400D58D9
3 changed files with 4 additions and 6 deletions

View File

@ -932,6 +932,7 @@ bool CConnman::AttemptToEvictConnection()
} }
} }
LOCK(node->cs_filter);
NodeEvictionCandidate candidate = {node->GetId(), node->nTimeConnected, node->nMinPingUsecTime, NodeEvictionCandidate candidate = {node->GetId(), node->nTimeConnected, node->nMinPingUsecTime,
node->nLastBlockTime, node->nLastTXTime, node->nLastBlockTime, node->nLastTXTime,
HasAllDesirableServiceFlags(node->nServices), HasAllDesirableServiceFlags(node->nServices),

View File

@ -911,7 +911,7 @@ public:
// If 'true', we identified it as an intra-quorum relay connection // If 'true', we identified it as an intra-quorum relay connection
std::atomic<bool> m_masternode_iqr_connection{false}; std::atomic<bool> m_masternode_iqr_connection{false};
CSemaphoreGrant grantOutbound; CSemaphoreGrant grantOutbound;
CCriticalSection cs_filter; mutable CCriticalSection cs_filter;
std::unique_ptr<CBloomFilter> pfilter PT_GUARDED_BY(cs_filter){nullptr}; std::unique_ptr<CBloomFilter> pfilter PT_GUARDED_BY(cs_filter){nullptr};
std::atomic<int> nRefCount{0}; std::atomic<int> nRefCount{0};
@ -953,7 +953,6 @@ public:
CCriticalSection cs_inventory; CCriticalSection cs_inventory;
std::chrono::microseconds nNextInvSend{0}; std::chrono::microseconds nNextInvSend{0};
// Used for headers announcements - unfiltered blocks to relay // Used for headers announcements - unfiltered blocks to relay
// Also protected by cs_inventory
std::vector<uint256> vBlockHashesToAnnounce GUARDED_BY(cs_inventory); std::vector<uint256> vBlockHashesToAnnounce GUARDED_BY(cs_inventory);
// Used for BIP35 mempool sending, also protected by cs_inventory // Used for BIP35 mempool sending, also protected by cs_inventory
bool fSendMempool GUARDED_BY(cs_inventory){false}; bool fSendMempool GUARDED_BY(cs_inventory){false};

View File

@ -1886,8 +1886,7 @@ void StopScriptCheckWorkerThreads()
scriptcheckqueue.StopWorkerThreads(); scriptcheckqueue.StopWorkerThreads();
} }
// Protected by cs_main VersionBitsCache versionbitscache GUARDED_BY(cs_main);
VersionBitsCache versionbitscache;
int32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Params& params, bool fCheckMasternodesUpgraded) int32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Params& params, bool fCheckMasternodesUpgraded)
{ {
@ -1943,8 +1942,7 @@ public:
} }
}; };
// Protected by cs_main static ThresholdConditionCache warningcache[VERSIONBITS_NUM_BITS] GUARDED_BY(cs_main);
static ThresholdConditionCache warningcache[VERSIONBITS_NUM_BITS];
static unsigned int GetBlockScriptFlags(const CBlockIndex* pindex, const Consensus::Params& consensusparams) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { static unsigned int GetBlockScriptFlags(const CBlockIndex* pindex, const Consensus::Params& consensusparams) EXCLUSIVE_LOCKS_REQUIRED(cs_main) {
AssertLockHeld(cs_main); AssertLockHeld(cs_main);