void () { myProcess.getManagerThread().schedule(new DebuggerCommandImpl() { @Override protected void action() { if (myObsolete.get()) return; VirtualMachine virtualMachine = myThread.getVirtualMachine().getVirtualMachine(); virtualMachine.suspend(); try { ThreadReference threadReference = myThread.getThreadReference(); if (!myObsolete.get() && threadReference.suspendCount() == 1) { // extra check for invocation in progress // resume all but this myAllResumed.set(true); threadReference.suspend(); DebuggerUtilsAsync.resume(virtualMachine); } } finally { DebuggerUtilsAsync.resume(virtualMachine); } } }); }