public void run(@NotNull final Runnable stuff) {
    if (ApplicationManager.getApplication().isHeadlessEnvironment()) {
      stuff.run();
      return;
    }

    synchronized (myLock) {
      myQueue.add(stuff);
    }
    startProgressIfNeeded();
  }
public void run(@NotNull final Runnable stuff)