A scalable, deadlock-resolving resource locker