static void unlock(Lock lock, S msg) { if (lock == null) ret; lock.unlock(); print("Unlocked: " + msg); // print afterwards to make sure the lock is always unlocked } static void unlock(Lock lock) { if (lock == null) ret; lock.unlock(); }