To detect a potential deadlock in a form of lock order inversion we have two mutually exclusive options:
- to set
DEBUG_LOCKORDER
that will causeabort()
orstd::logic_error
exception - to use the ThreadSanitizer
Using both options simultaneously does not work as in the former case lock()
is not called if lock order inversion is detected, and the ThreadSanitizer fails to warn about the issue.
I believe we should allow the ThreadSanitizer to detect potential deadlocks in a CI job.