HomePhabricator

refactor: replace RecursiveMutex cs_SubVer with Mutex (and rename)

Description

refactor: replace RecursiveMutex cs_SubVer with Mutex (and rename)

Summary:

scripted-diff: rename cs_SubVer -> m_subver_mutex

-BEGIN VERIFY SCRIPT-
sed -i 's/cs_SubVer/m_subver_mutex/g' ./src/net.h ./src/net.cpp ./src/net_processing.cpp
-END VERIFY SCRIPT-

refactor: replace RecursiveMutex m_subver_mutex with Mutex

In each of the critical sections, only the the guarded variable is
accessed, without any chance that within one section another one is
called. Hence, we can use an ordinary Mutex instead of RecursiveMutex.

This is a backport of core#24079

Test Plan:
With Debug and TSAN

ninja all check check-functional

Reviewers: #bitcoin_abc, sdulfari

Reviewed By: #bitcoin_abc, sdulfari

Differential Revision: https://reviews.bitcoinabc.org/D13381

Details

Provenance
PiRKAuthored on Mar 17 2023, 15:56
PiRKPushed on Mar 20 2023, 07:09
Reviewer
Restricted Project
Differential Revision
D13381: refactor: replace RecursiveMutex cs_SubVer with Mutex (and rename)
Parents
rABC9260d513fa43: Refactor: Uses c++ init convention for time variables
Branches
Unknown
Tags
Unknown