Summary:
- Reduce 4 of the
MaybeCheckNotHeld()definitions to 2 by using a template. - Remove unused template parameter from
::UniqueLock. - Use
MutexTypeinstead ofMutexfor a template parameter name to avoid overlap/confusion with theMutexclass. - Rename
AnnotatedMixin::UniqueLocktoAnnotatedMixin::unique_lockto avoid overlap/confusion with the globalUniqueLockand for consistency withUniqueLock::reverse_lock.
The first commit sync: simplify MaybeCheckNotHeld() definitions by using a template is also part of https://github.com/bitcoin/bitcoin/pull/25390