void () { // another thread final Semaphore local = new Semaphore(); local.down(); myThread = AppExecutorUtil.getAppExecutorService().submit(() -> { try { local.up(); myRunnable.run(); } finally { myChildExited = true; } }); local.waitFor(); myExecutionSubmitted = false; // hack: to check further submissions }