This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 186172
Collapse All | Expand All

(-)a/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/execution/NativeExecutionService.java (-2 / +18 lines)
Lines 202-215 Link Here
202
        FutureTask<Integer> runTask = new FutureTask<Integer>(callable) {
202
        FutureTask<Integer> runTask = new FutureTask<Integer>(callable) {
203
203
204
            @Override
204
            @Override
205
            /**
206
             * @return <tt>true</tt>
207
             */
205
            public boolean cancel(boolean mayInterruptIfRunning) {
208
            public boolean cancel(boolean mayInterruptIfRunning) {
206
                synchronized (processRef) {
209
                synchronized (processRef) {
207
                    boolean ret = super.cancel(mayInterruptIfRunning);
210
                    /* *** Bug 186172 ***
211
                     *
212
                     * Do NOT call super.cancel() here as it will interrupt
213
                     * waiting thread (see callable's that this task is created
214
                     * from) and will initiate a postExecutionTask BEFORE the
215
                     * process is terminated.
216
                     * Just need to terminate the process. The process.waitFor()
217
                     * will naturally return then.
218
                     *
219
                     */
220
//                    boolean ret = super.cancel(mayInterruptIfRunning);
221
208
                    NativeProcess process = processRef.get();
222
                    NativeProcess process = processRef.get();
223
209
                    if (process != null) {
224
                    if (process != null) {
210
                        process.destroy();
225
                        process.destroy();
211
                    }
226
                    }
212
                    return ret;
227
228
                    return true;
213
                }
229
                }
214
            }
230
            }
215
        };
231
        };

Return to bug 186172