With the exception some usages of cs_main and a few (Recursive)Mutexes, Bitcoin has replaced their usage of LOCKS_EXCLUDED(cs) with EXCLUSIVE_LOCKS_REQUIRED(!cs) due to the stricter enforcement that negative locking brings with Clang (and it having a trickle-up effect caused by needing lock annotations on calling functions as well).
Dash intensively uses LOCKS_EXCLUDED for Dash-specific logic and moving it over also required updating (or adding) lock annotations for calling functions.
This pull request is being opened due to an upcoming pull request that includes https://github.com/bitcoin/bitcoin/pull/25109, which requires all AssertLockNotHeld usage to accompany a negative lock annotation.
Breaking Changes
None expected. (Negative) lock enforcement has been made stricter but no new locks should be introduced by changes.
Checklist:
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas (note: N/A)
[x] I have added or updated relevant unit/integration/functional/e2e tests (note: N/A)
[x] I have made corresponding changes to the documentation (note: N/A)
[x] I have assigned this pull request to a milestone (for repository code-owners and collaborators only)
Additional Information
With the exception some usages of
cs_main
and a few (Recursive
)Mutex
es, Bitcoin has replaced their usage ofLOCKS_EXCLUDED(cs)
withEXCLUSIVE_LOCKS_REQUIRED(!cs)
due to the stricter enforcement that negative locking brings with Clang (and it having a trickle-up effect caused by needing lock annotations on calling functions as well).Dash intensively uses
LOCKS_EXCLUDED
for Dash-specific logic and moving it over also required updating (or adding) lock annotations for calling functions.This pull request is being opened due to an upcoming pull request that includes https://github.com/bitcoin/bitcoin/pull/25109, which requires all
AssertLockNotHeld
usage to accompany a negative lock annotation.Breaking Changes
None expected. (Negative) lock enforcement has been made stricter but no new locks should be introduced by changes.
Checklist: