void (@NotNull Boolean afterGc) { // Clearing `mySubmitted` before all listeners are called, to avoid data races when a listener is added in the middle of execution // and is lost. This may, however, cause listeners to execute more than once (potentially even in parallel). synchronized (myJanitor) { mySubmitted = null; } LowMemoryWatcher.onLowMemorySignalReceived(afterGc); }