HomePhabricator

Replace RecursiveMutex cs_mapLocalHost with Mutex, and rename it

Description

Replace RecursiveMutex cs_mapLocalHost with Mutex, and rename it

Summary:

scripted-diff: rename cs_mapLocalHost -> g_maplocalhost_mutex

-BEGIN VERIFY SCRIPT-
s() { sed -i 's/cs_mapLocalHost/g_maplocalhost_mutex/g' $1; }
s src/net.cpp
s src/net.h
s src/rpc/net.cpp
s src/test/net_tests.cpp
-END VERIFY SCRIPT-

Within all critical sections that are protected by g_maplocalhost_mutex, there is no chance another one is called, i.e. a regular Mutex is sufficient.

This is a backport of core#24099

Test Plan:
With Debug and TSAN

ninja all check check-functional

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
PiRKAuthored on Apr 3 2023, 13:13
PiRKPushed on Apr 4 2023, 05:50
Reviewer
Restricted Project
Differential Revision
D13540: Replace RecursiveMutex cs_mapLocalHost with Mutex, and rename it
Parents
rABC39373b71509c: Use block policy state instead of parked state to determine if a policy was…
Branches
Unknown
Tags
Unknown