static void lockOrFail(Lock lock, long timeout) ctex { ping(); vmBus_send locking(lock, thread := currentThread()); if (!lock.tryLock(timeout, TimeUnit.MILLISECONDS)) { S s = "Couldn't acquire lock after " + timeout + " ms."; if (lock instanceof ReentrantLock) { ReentrantLock l = cast lock; s += " Hold count: " + l.getHoldCount() + ", owner: " + call(l, "getOwner"); } fail(s); } vmBus_send locked(lock, thread := currentThread()); ping(); }