Commit 0be1dc1
MacroFake
Merge bitcoin#24062: refactor: replace RecursiveMutex
83003ff refactor: replace RecursiveMutex `m_most_recent_block_mutex` with Mutex (Sebastian Falbesoner)
8edd0d3 refactor: reduce scope of lock `m_most_recent_block_mutex` (Sebastian Falbesoner)
Pull request description:
This PR is related to bitcoin#19303 and gets rid of the RecursiveMutex `m_most_recent_block_mutex`. All of the critical sections (5 in total) only directly access the guarded elements, i.e. it is not possible that within one section another one is called, and we can use a regular Mutex:
https://github.com/bitcoin/bitcoin/blob/b019cdc036343a437fd7ced85467bd95f48d84c4/src/net_processing.cpp#L1650-L1655
https://github.com/bitcoin/bitcoin/blob/b019cdc036343a437fd7ced85467bd95f48d84c4/src/net_processing.cpp#L1861-L1865
https://github.com/bitcoin/bitcoin/blob/b019cdc036343a437fd7ced85467bd95f48d84c4/src/net_processing.cpp#L3149-L3152
https://github.com/bitcoin/bitcoin/blob/b019cdc036343a437fd7ced85467bd95f48d84c4/src/net_processing.cpp#L3201-L3206
https://github.com/bitcoin/bitcoin/blob/b019cdc036343a437fd7ced85467bd95f48d84c4/src/net_processing.cpp#L4763-L4769
The scope of the last critical section is reduced in the first commit, in order to avoid calling the non-trivial method `CConnman::PushMessage` while the lock is held.
ACKs for top commit:
furszy:
Code ACK 83003ff with a small comment.
hebasto:
ACK 83003ff
w0xlt:
ACK bitcoin@83003ff
Tree-SHA512: 3df290cafd2f6c4d40afb9f14e822a77d9c1828e66f5e2233f3ac1deccc2b0a8290bc5fb8eb992f49d39e887b50bc0e9aad63e05db2d870791a8d409fb95695fm_most_recent_block_mutex with Mutex1 file changed
+6
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
687 | 687 | | |
688 | 688 | | |
689 | 689 | | |
690 | | - | |
| 690 | + | |
691 | 691 | | |
692 | 692 | | |
693 | 693 | | |
| |||
4759 | 4759 | | |
4760 | 4760 | | |
4761 | 4761 | | |
4762 | | - | |
| 4762 | + | |
4763 | 4763 | | |
4764 | 4764 | | |
4765 | 4765 | | |
4766 | | - | |
4767 | | - | |
| 4766 | + | |
4768 | 4767 | | |
4769 | 4768 | | |
4770 | | - | |
| 4769 | + | |
| 4770 | + | |
| 4771 | + | |
4771 | 4772 | | |
4772 | 4773 | | |
4773 | 4774 | | |
| |||
0 commit comments