mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-28 13:02:38 +02:00
Add ChainstateManager::GetMutex(), an alias for ::cs_main
This commit is contained in:
parent
0f90b58686
commit
fa530bcb9c
@ -868,6 +868,19 @@ public:
|
||||
const CChainParams& GetParams() const { return m_chainparams; }
|
||||
const Consensus::Params& GetConsensus() const { return m_chainparams.GetConsensus(); }
|
||||
|
||||
/**
|
||||
* Alias for ::cs_main.
|
||||
* Should be used in new code to make it easier to make ::cs_main a member
|
||||
* of this class.
|
||||
* Generally, methods of this class should be annotated to require this
|
||||
* mutex. This will make calling code more verbose, but also help to:
|
||||
* - Clarify that the method will acquire a mutex that heavily affects
|
||||
* overall performance.
|
||||
* - Force call sites to think how long they need to acquire the mutex to
|
||||
* get consistent results.
|
||||
*/
|
||||
RecursiveMutex& GetMutex() const LOCK_RETURNED(::cs_main) { return ::cs_main; }
|
||||
|
||||
std::thread m_load_block;
|
||||
//! A single BlockManager instance is shared across each constructed
|
||||
//! chainstate to avoid duplicating block metadata.
|
||||
|
Loading…
Reference in New Issue
Block a user