void (@NotNull final Runnable stuff) { if (ApplicationManager.getApplication().isHeadlessEnvironment()) { stuff.run(); return; } synchronized (myLock) { myQueue.add(stuff); } startProgressIfNeeded(); }