Make LOCK, LOCK2, TRY_LOCK work with CWaitableCriticalSection
Summary:
- Add unit test for DEBUG_LOCKORDER code
- MOVEONLY Move AnnotatedMixin declaration
Move AnnotatedMixin closer to where it's used, and after the DEBUG_LOCKORDER
function declarations so it can call them.
- Make LOCK, LOCK2, TRY_LOCK work with CWaitableCriticalSection
They should also work with any other mutex type which std::unique_lock
supports.
There is no change in behavior for current code that calls these macros with
CCriticalSection mutexes.
- Use LOCK macros for non-recursive locks
Instead of std::unique_lock.
This is a backport of Core PR11640
Depends on D1922
Test Plan:
make check
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Subscribers: jasonbcox, teamcity
Differential Revision: https://reviews.bitcoinabc.org/D1923