deadlock-detection-harness
Installation
SKILL.md
deadlock-detection-harness
A deadlock = a cycle in the lock-wait graph: thread A holds X waiting for Y; thread B holds Y waiting for X. Tests prevent deadlocks via static analysis of lock acquisition order + runtime detection (timeouts, sanitizer, postmortem dumps).
When to use
- Service has multiple locks/mutexes and complex code paths.
- Production hang reported; need to (a) reproduce and (b) prevent recurrence.
- Pre-release:
detect_deadlocksThreadSanitizer mode passes on the test workload.
Step 1 - Lock-order convention
Establish a strict ordering for all locks and document it: