Memory safety does not prevent deadlock
Mutex guards protect data races, but two threads can still wait forever when they acquire the same locks in opposite order. A stable global order removes the circular-wait condition for this lock set.
rust / LEVEL 4
THEORY / RETRIEVAL
Mutex guards protect data races, but two threads can still wait forever when they acquire the same locks in opposite order. A stable global order removes the circular-wait condition for this lock set.
Self-transfers, invalid indices and invalid amounts should be rejected before acquiring locks. This keeps critical sections small and avoids trying to lock the same non-reentrant mutex twice.
CHECKPOINT
02 / DEBUGGING
Repair `transfer`: reject invalid operations and acquire two account locks in a stable order while still applying debit and credit to the requested direction.
Runner is waiting for a submission.