A deadlock needs two threads and two locks acquired in opposite orders:
thread 1: lock A ─── wants B
thread 2: lock B ─── wants A
Neither can proceed and neither will time out. Rust prevents data races at compile time; it does not prevent deadlocks, because a deadlock is not unsound — it is a liveness bug, and the type system has nothing to say about it.
A transfer function is the canonical way to write one by accident: transfer(a, b) and transfer(b, a) running at once acquire in opposite orders.
