2 ms·
> Avoid acquiring more than one lock at the same time if possible. If you know you're going to need 2 locks and you acquire both of them at the same time atomi
by dreamcompiler 7y ago
> Avoid acquiring more than one lock at the same time if possible.
If you know you're going to need 2 locks and you acquire both of them at the same time atomically, deadlock is impossible. The trouble happens when you acquire one lock, wait a bit, then acquire a second one. Maybe that's what you meant and I just misread it.