refactor: replace RecursiveMutex `cs_sendProcessing` with Mutex
The mutex cs_sendProcessing is currently only acquired at one location in the code:
https://github.com/bitcoin/bitcoin/blob/7d258ee8bc3bff439881064dd6234f7b04982783/src/net.cpp#L1998-L2001
apparently with the intention to execute the method for sending messages (NetEventsInterface::SendMessages(...)) in serial order, in the case that we ever had more than one message handling thread. With no possibility to re-acquire the mutex in the same thread, there is no reason for it to be a RecursiveMutex, so we can change it to an ordinary Mutex instead.
(An alternative would be to just get rid of the mutex, as it currently doesn't serve any purpose, as long as we only have one message handling thread.)
See also https://github.com/bitcoin/bitcoin/pull/24474/commits/b1af785346cd2c932fd1310df10f757ba1346c2b (https://github.com/bitcoin/bitcoin/pull/24474/commits/b1af785346cd2c932fd1310df10f757ba1346c2b)
See also b1af785 (
https://github.com/bitcoin/bitcoin/pull/24474/commits/b1af785346cd2c932fd1310df10f757ba1346c2b)
Or #26036 more broadly
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #26036 (net: add NetEventsInterface::g_msgproc_mutex by ajtowns)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
🐙 This pull request conflicts with the target branch and needs rebase.
Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".
Are you still working on this?
This mutex no longer exists since #26036 / bf12abe4542f2cf658516ea7e7fbbff6864c2208. Closing.