Page MenuHomePhabricator

Make LOCK, LOCK2, TRY_LOCK work with CWaitableCriticalSection
ClosedPublic

Authored by deadalnix on Oct 11 2018, 22:30.

Details

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

Diff Detail

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

Event Timeline

jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
src/test/sync_tests.cpp
45 ↗(On Diff #5393)

Ugh. The fact that global state leads to shit like this in tests is astounding.

This revision is now accepted and ready to land.Oct 16 2018, 05:05
This revision was automatically updated to reflect the committed changes.