-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Description
UPD 2023-04-18. See a shortlist here.
This is a tracking issue for the long-term goal to replace all of the RecursiveMutex
instances with the Mutex
ones throughout the code base.
Anthony Williams (C++ Concurrency in Action, 2019, 3.3.3 Recursive locking):
Most of the time, if you think you want a recursive mutex, you probably need to change your design instead.
Anthony Towns, #19303 (comment):
... the actual goal is "make locking logic easier to follow" rather than "remove RecurviseMutex"
Should be noted, to insure that mutex locking policy has not been changed by accident in non-trivial cases, all of the related code branches must be covered by appropriate lock assertions: AssertLockHeld()
or AssertLockNotHeld()
.
Also Clang Thread Safety Analysis annotations with Negative Capabilities are very useful (see #19249) but are not a panacea, of course :)
-
RecursiveMutex cs_Shutdown
(refactor: Replace RecursiveMutex with Mutex in Shutdown() #19180) -
RecursiveMutex cs_nTimeOffset
(refactor: Replace RecursiveMutex with Mutex in timedata.cpp #19189) -
RecursiveMutex cs_proxyInfos
(refactor: Replace RecursiveMutex with Mutex in netbase.cpp #19190) RecursiveMutex csPathCached
(util: Get rid of RecursiveMutex in Get{Blocks,Data}Dir #19213)-
RecursiveMutex cs_warnings
(refactor: Replace RecursiveMutex with Mutex in warnings.cpp #19220) -
RecursiveMutex CAddrMan::cs
(refactor: Make CAddrMan::cs non-recursive #19238) -
RecursiveMutex BanMan::m_cs_banned
(refactor: replace RecursiveMutexm_cs_banned
with Mutex (and rename) #24092, Replace RecursiveMutex m_cs_banned with Mutex, and rename it #24097) -
RecursiveMutex cs_mapLocalHost
(ReplaceRecursiveMutex cs_mapLocalHost
with Mutex, and rename it #24099) -
RecursiveMutex CConnman::cs_totalBytesRecv
(refactor: various RecursiveMutex replacements in CConnman #22829) -
RecursiveMutex CConnman::cs_totalBytesSent
(p2p: Replace RecursiveMutexcs_totalBytesSent
with Mutex and rename it #24157) -
RecursiveMutex CConnman::m_addr_fetches_mutex
(refactor: various RecursiveMutex replacements in CConnman #22829) -
RecursiveMutex CConnman::cs_vAddedNodes
(refactor: various RecursiveMutex replacements in CConnman #22829) -
RecursiveMutex CConnman::m_nodes_mutex
(net: make m_nodes_mutex non-recursive #32394) -
RecursiveMutex CNode::cs_vSend
(p2p, refactor: Use Mutex type for some mutexes in CNode class #19915) -
RecursiveMutex CNode::cs_hSocket
(p2p, refactor: Use Mutex type for some mutexes in CNode class #19915) -
RecursiveMutex CNode::cs_vRecv
(p2p, refactor: Use Mutex type for some mutexes in CNode class #19915) RecursiveMutex CNode::cs_vProcessMsg
(refactor: replace RecursiveMutexcs_vProcessMsg
with Mutex (and rename) #24122)RecursiveMutex CNode::cs_sendProcessing
(refactor: replace RecursiveMutexcs_sendProcessing
with Mutex #25597)-
RecursiveMutex CNode::cs_SubVer
(refactor: replace RecursiveMutexcs_SubVer
with Mutex (and rename) #24079) -
RecursiveMutex CNode::cs_inventory
([net] Make cs_inventory nonrecursive #19347) -
RecursiveMutex CNode::cs_addrName
(removed in Remove unused MaybeSetAddrName #22782) -
RecursiveMutex CNode::cs_addrLocal
Replace RecursiveMutexcs_addrLocal
with Mutex, and rename it #24108 -
RecursiveMutex Peer::TxRelay::m_bloom_filter_mutex
-
RecursiveMutex Peer::TxRelay::m_tx_inventory_mutex
(p2p: Replace RecursiveMutexm_tx_inventory_mutex
with Mutex and rename it #24125) -
RecursiveMutex CNode::TxRelay::cs_feeFilter
(net: Replace cs_feeFilter with simple std::atomic #18819) RecursiveMutex g_cs_orphans
-
RecursiveMutex g_cs_recent_confirmed_transactions
(refactor: Use Mutex type for g_cs_recent_confirmed_transactions #19378) -
RecursiveMutex cs_most_recent_block
(refactor: replace RecursiveMutexm_most_recent_block_mutex
with Mutex #24062) -
RecursiveMutex CBlockPolicyEstimator::m_cs_fee_estimator
(refactor: Make m_cs_fee_estimator non-recursive #22014) -
RecursiveMutex cs_rpcWarmup
(refactor: Replace RecursiveMutex with Mutex in rpc/server.cpp #19399) -
RecursiveMutex SingleThreadedSchedulerClient::m_cs_callbacks_pending
(refactor: replace RecursiveMutexm_cs_callbacks_pending
with Mutex (and rename) #24069) -
RecursiveMutex BlockManager::cs_LastBlockFile
-
RecursiveMutex FillableSigningProvider::cs_KeyStore
-
RecursiveMutex ArgsManager::cs_args
-
RecursiveMutex CChainState::cs_nBlockSequenceId
(refactor: remove RecursiveMutex cs_nBlockSequenceId #22824) -
RecursiveMutex CChainState::m_cs_chainstate
(Replace RecursiveMutexm_cs_chainstate
with Mutex, and rename it #24103) -
RecursiveMutex cs_db
-
RecursiveMutex DescriptorScriptPubKeyMan::cs_desc_man
-
RecursiveMutex cs_wallets
(refactor: remove ::vpwallets and related global variables #19101) -
RecursiveMutex CWallet::cs_wallet
(wallet: Avoid recursive lock in IsTrusted #19773, wallet: Avoid locking cs_wallet recursively #19833)
and
RecursiveMutex CTxMemPool::cs
(refactor: Replace RecursiveMutex with Mutex in CTxMemPool #19306,Add thread safety annotations to CTxMemPool methods #19647, Avoid locking CTxMemPool::cs recursively in Mempool{Info}ToJSON() #19652, Avoid locking CTxMemPool::cs recursively in simple cases #19854, Avoid locking CTxMemPool::cs recursively in some cases #19872, Avoid locking CTxMemPool::cs recursively in CTxMemPool::DynamicMemoryUsage() #19901, refactor: Remove unused CTxMemPool::clear() helper #19909, Yet another change to reduce recursive mempool locking #19917)RecursiveMutex cs_main