static void lock(Lock lock) ctex { ping(); if (lock == null) ret; try { lock.lockInterruptibly(); } catch (InterruptedException e) { print("Locking interrupted! I probably deadlocked, oops."); printStackTrace(e); rethrow(e); } ping(); } static void lock(Lock lock, S msg) { print("Locking: " + msg); lock(lock); } static void lock(Lock lock, S msg, long timeout) { print("Locking: " + msg); lockOrFail(lock, timeout); } static ReentrantLock lock() { ret fairLock(); }