public ClassLock lock(Class<?> clazz) {
        return lockWhile(clazz, () -> true);
    }
Locks key. This will block until the key is acquired.
Users of this <b>must</b> close any lock acquired.
vespajlib/src/main/java/com/yahoo/concurrent/classlock/ClassLocking.java