void () { SingleTaskController.SingleTask initialization; synchronized (myLock) { initialization = myInitialization; myInitialization = null; myState = State.DISPOSED; } if (initialization != null) { initialization.cancel(); try { initialization.waitFor(1, TimeUnit.MINUTES); } catch (InterruptedException | ExecutionException | TimeoutException e) { LOG.warn(e); } } resetState(); }