To detect a potential deadlock in a form of lock order inversion we have two mutually exclusive options:
- to set
DEBUG_LOCKORDERthat will causeabort()orstd::logic_errorexception - 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.