void () { if (myProject.isDisposed()) return; synchronized (myLock) { if (!myIsStarted || myActive || myQueue.isEmpty()) return; myActive = true; } new Task.Backgroundable(myProject, myTitle) { @Override public void run(@NotNull ProgressIndicator indicator) { pumpQueue(); } }.queue(); }