Thread 1 locks A then B; thread 2 locks B then A. · QuantMax