Page MenuHomePhabricator

sync.h: Add GlobalMutex type
ClosedPublic

Authored by PiRK on Dec 1 2023, 13:14.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC4d473df4beef: sync.h: Add GlobalMutex type
Summary

And convert global Mutexes to GlobalMutexes:

-BEGIN VERIFY SCRIPT-
sed -i -E -e '/^([a-z]+ )?Mutex [a-z]/ s/Mutex/GlobalMutex/' $(git grep -lE '^([a-z]+ )?Mutex [a-z]')
-END VERIFY SCRIPT-

This is a partial backport of core#24931
https://github.com/bitcoin/bitcoin/pull/24931/commits/a559509a0b8cade27199740212d7b589f71a0e3b
https://github.com/bitcoin/bitcoin/pull/24931/commits/d2852917eecad6ab422a7b2c9892d351a7f0cc96

Depends on D14892

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK published this revision for review.Dec 1 2023, 13:24

Not cs_main ?

That's a RecursiveMutex. But they are treated the same way as GlobalMutex in D14894: LOCKS_EXCLUDED, just check that it is not taken twice in the same scope.

This revision is now accepted and ready to land.Dec 3 2023, 11:19
This revision was automatically updated to reflect the committed changes.