forked from bitcoin-core/gui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit 76392b0

MarcoFalke
Merge bitcoin/bitcoin#22829: refactor: various RecursiveMutex replacements in CConnman
3726a45 refactor: replace RecursiveMutex m_added_nodes_mutex with Mutex (Sebastian Falbesoner)
7d52ff5 refactor: replace RecursiveMutex m_addr_fetches_mutex with Mutex (Sebastian Falbesoner)
d51d2a3 scripted-diff: rename node vector/mutex members in CConnman (Sebastian Falbesoner)
574cc42 refactor: remove RecursiveMutex cs_totalBytesRecv, use std::atomic instead (Sebastian Falbesoner)
Pull request description:
This PR is related to #19303 and gets rid of the following RecursiveMutex members in class `CConnman`:
* for `cs_totalBytesRecv`, protecting `nTotalBytesRecv`, `std::atomic` is used instead (the member is only increment at one and read at another place, so this is sufficient)
* for `m_addr_fetches_mutex`, protecting `m_addr_fetches`, a regular `Mutex` is used instead (there is no chance that within one critical section, another one is called)
* for `cs_vAddedNodes`, protecting `vAddedNodes`, a regular `Mutex` is used instead (there is no chance that within one critical section, another one is called)
Additionally, the PR takes the chance to rename all node vector members (vNodes, vAddedNodes) and its corresponding mutexes (cs_vNodes, cs_vAddedNodes) to match the coding guidelines via a scripted-diff.
ACKs for top commit:
vasild:
ACK 3726a45
promag:
Code review ACK 3726a45.
hebasto:
re-ACK 3726a45
Tree-SHA512: 4f5ad41ba2eca397795080988c1739c6abb44c1204dddaa75cc38a396fa821fbe1010694ba7bead1b606beaa677661e66da2a5dca233b2937214f63a54848348
0 commit comments