mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Merge #14444: Add compile time checking for cs_main locks which we assert at run time
0089905361 Add compile time checking for cs_main locks which we assert at run time (practicalswift) Pull request description: Assert locking requirements at compile-time (`EXCLUSIVE_LOCKS_REQUIRED(foo)`) instead of at run-time (`AssertLockHeld(…)`). Tree-SHA512: f4965ebf4bb5dbf5e7ed738cacf82c0f6cd55134fb968860bf84a84e29806485617f223910bb8c5461213f1829b0137c64ba1f6d6a2008b3cac3bb3a28df9324
This commit is contained in:
parent
dc425c3fea
commit
9b4571a133
@ -68,7 +68,7 @@ bool BaseIndex::Init()
|
||||
return true;
|
||||
}
|
||||
|
||||
static const CBlockIndex* NextSyncBlock(const CBlockIndex* pindex_prev)
|
||||
static const CBlockIndex* NextSyncBlock(const CBlockIndex* pindex_prev) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
|
||||
|
@ -274,7 +274,7 @@ bool LoadGenesisBlock(const CChainParams& chainparams);
|
||||
* initializing state if we're running with -reindex. */
|
||||
bool LoadBlockIndex(const CChainParams& chainparams) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||
/** Update the chain tip based on database information. */
|
||||
bool LoadChainTip(const CChainParams& chainparams);
|
||||
bool LoadChainTip(const CChainParams& chainparams) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||
/** Unload database information */
|
||||
void UnloadBlockIndex();
|
||||
/** Run instances of script checking worker threads */
|
||||
@ -450,7 +450,7 @@ inline CBlockIndex* LookupBlockIndex(const uint256& hash)
|
||||
}
|
||||
|
||||
/** Find the last common block between the parameter chain and a locator. */
|
||||
CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& locator);
|
||||
CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& locator) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||
|
||||
/** Mark a block as precious and reorganize.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user