HomePhabricator

refactor: Replace RecursiveMutex with Mutex in warnings.cpp

Description

refactor: Replace RecursiveMutex with Mutex in warnings.cpp

Summary:

The functions that could lock this mutex, i.e., SetMiscWarning(), {S,G}etfLargeWorkForkFound(), SetfLargeWorkInvalidChainFound(), GetWarnings(), do not call itself recursively, and do not call each other either directly or indirectly. Therefore, the g_warnings_mutex could be a non-recursive mutex.

This is a backport of core#19220

Test Plan:

CC=clang CXX=clang++ cmake .. -DENABLE_SANITIZERS=thread -GNinja
ninja all check check-functional

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Subscribers: majcosta

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

Details

Provenance
Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>Authored on Jun 9 2020, 06:35
PiRKCommitted on Mar 10 2021, 13:17
PiRKPushed on Mar 10 2021, 13:17
Reviewer
Restricted Project
Differential Revision
D9311: refactor: Replace RecursiveMutex with Mutex in warnings.cpp
Parents
rABCd57900986215: refactor: Replace RecursiveMutex with Mutex in timedata.cpp
Branches
Unknown
Tags
Unknown