mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
bug 419396: CommandLauncher may hang eclipse
This commit is contained in:
parent
25ea069927
commit
410d532bde
2 changed files with 9 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2012 Andrew Gvozdev and others.
|
* Copyright (c) 2012, 2013 Andrew Gvozdev and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -287,6 +287,8 @@ public class BuildRunnerHelper implements Closeable {
|
||||||
if (!isCancelled && project != null) {
|
if (!isCancelled && project != null) {
|
||||||
project.setSessionProperty(progressPropertyName, new Integer(streamProgressMonitor.getWorkDone()));
|
project.setSessionProperty(progressPropertyName, new Integer(streamProgressMonitor.getWorkDone()));
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
CCorePlugin.log(e);
|
||||||
} finally {
|
} finally {
|
||||||
monitor.done();
|
monitor.done();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2008 IBM Corporation and others.
|
* Copyright (c) 2000, 2013 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -17,6 +17,8 @@ import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
|
import org.eclipse.core.runtime.Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bundled state of a launched process including the threads linking the process
|
* Bundled state of a launched process including the threads linking the process
|
||||||
* in/output to console documents.
|
* in/output to console documents.
|
||||||
|
@ -33,11 +35,11 @@ public class ProcessClosure {
|
||||||
private OutputStream fOutputStream;
|
private OutputStream fOutputStream;
|
||||||
private boolean fFinished = false;
|
private boolean fFinished = false;
|
||||||
private String lineSeparator;
|
private String lineSeparator;
|
||||||
/*
|
|
||||||
* outputStream can be null
|
|
||||||
*/
|
|
||||||
public ReaderThread(ThreadGroup group, String name, InputStream in, OutputStream out) {
|
public ReaderThread(ThreadGroup group, String name, InputStream in, OutputStream out) {
|
||||||
super(group, name);
|
super(group, name);
|
||||||
|
Assert.isNotNull(in);
|
||||||
|
Assert.isNotNull(out);
|
||||||
fOutputStream = out;
|
fOutputStream = out;
|
||||||
fInputStream = in;
|
fInputStream = in;
|
||||||
setDaemon(true);
|
setDaemon(true);
|
||||||
|
@ -58,7 +60,6 @@ public class ProcessClosure {
|
||||||
// ignore
|
// ignore
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
// writer.flush();
|
|
||||||
fOutputStream.flush();
|
fOutputStream.flush();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// ignore
|
// ignore
|
||||||
|
|
Loading…
Add table
Reference in a new issue