static void lock(Lock lock) ctex { ping(); if (lock == null) ret; try { vmBus_send locking(lock, thread := currentThread()); lock.lockInterruptibly(); vmBus_send locked(lock, thread := currentThread()); } catch (InterruptedException e) { O reason = vm_threadInterruptionReasonsMap().get(currentThread()); print("Locking interrupted! Reason: " + strOr(reason, "Unknown"); printStackTrace(e); rethrow(e); } // NO call to ping here! Make sure lock is always released. } 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(); }