Get two locks at once; in order to prevent deadlock, don't keep one lock if both cannot be obtained.
TODO: Can I make this generic for n locks?
Unlock two locks at once.
Lock one lock and unlock another.