--- a/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/execution/NativeExecutionService.java Wed May 26 19:59:00 2010 +0400 +++ a/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/execution/NativeExecutionService.java Thu May 27 00:17:45 2010 +0400 @@ -202,14 +202,30 @@ FutureTask runTask = new FutureTask(callable) { @Override + /** + * @return true + */ public boolean cancel(boolean mayInterruptIfRunning) { synchronized (processRef) { - boolean ret = super.cancel(mayInterruptIfRunning); + /* *** Bug 186172 *** + * + * Do NOT call super.cancel() here as it will interrupt + * waiting thread (see callable's that this task is created + * from) and will initiate a postExecutionTask BEFORE the + * process is terminated. + * Just need to terminate the process. The process.waitFor() + * will naturally return then. + * + */ +// boolean ret = super.cancel(mayInterruptIfRunning); + NativeProcess process = processRef.get(); + if (process != null) { process.destroy(); } - return ret; + + return true; } } };