void (final @NotNull Runnable runnable, final boolean urgent, final boolean anyModality) { synchronized (myLock) { if (myAlarm.isDisposed()) return; final boolean wasRaised = myRaised; myRaised = true; if (!wasRaised) { final Runnable request = new Runnable() { @Override public void run() { synchronized (myLock) { if (!myRaised) return; myRaised = false; } BackgroundTaskUtil.runUnderDisposeAwareIndicator(myAlarm, runnable); } @Override public String toString() { return runnable.toString(); } }; addRequest(request, urgent, anyModality); } } }