HomePhabricator

refactor: replace RecursiveMutex m_most_recent_block_mutex with Mutex

Description

refactor: replace RecursiveMutex m_most_recent_block_mutex with Mutex

Summary:

refactor: reduce scope of lock m_most_recent_block_mutex

This avoids calling the non-trivial method
CConnman::PushMessage within the critical section.

refactor: replace RecursiveMutex m_most_recent_block_mutex with Mutex

In each of the critical sections, only the the guarded variables are
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#24062

Depends on D14878

Test Plan:

cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug  -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
Sebastian Falbesoner <sebastian.falbesoner@gmail.com>Authored on Jan 25 2022, 15:10
PiRKCommitted on Dec 1 2023, 09:22
PiRKPushed on Dec 1 2023, 09:22
Reviewer
Restricted Project
Differential Revision
D14880: refactor: replace RecursiveMutex m_most_recent_block_mutex with Mutex
Parents
rABCcff0f65aaae2: use cached most recent compact block when available
Branches
Unknown
Tags
Unknown