void (@NotNull Runnable runnable) { @SuppressWarnings("InstantiatingAThreadWithDefaultRunMethod") Thread fake = new Thread("fake"); try { threadsUnderCanceledIndicator.add(fake); runnable.run(); } finally { threadsUnderCanceledIndicator.remove(fake); } }