public void runWithLock(Runnable runnable) {
      try {
        locked = true;
        runnable.run();
      } finally {
        locked = false;
      }
    }
public void runWithLock(Runnable runnable)