mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Remove workaround for J9
This commit is contained in:
parent
e075c3c614
commit
0c38e196c5
1 changed files with 8 additions and 37 deletions
|
@ -134,40 +134,8 @@ public class CommandLauncher {
|
||||||
PipedOutputStream outputPipe = new PipedOutputStream();
|
PipedOutputStream outputPipe = new PipedOutputStream();
|
||||||
PipedInputStream errInPipe, inputPipe;
|
PipedInputStream errInPipe, inputPipe;
|
||||||
try {
|
try {
|
||||||
errInPipe = new PipedInputStream(errOutPipe) {
|
errInPipe = new PipedInputStream(errOutPipe);
|
||||||
/**
|
inputPipe = new PipedInputStream(outputPipe);
|
||||||
* FIXME: To remove when j9 is fix.
|
|
||||||
* The overloading here corrects a bug in J9
|
|
||||||
* When the ring buffer when full it returns 0 .
|
|
||||||
*/
|
|
||||||
public synchronized int available() throws IOException {
|
|
||||||
if(in < 0 || buffer == null)
|
|
||||||
return 0;
|
|
||||||
else if(in == out)
|
|
||||||
return buffer.length;
|
|
||||||
else if (in > out)
|
|
||||||
return in - out;
|
|
||||||
else
|
|
||||||
return in + buffer.length - out;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
inputPipe = new PipedInputStream(outputPipe) {
|
|
||||||
/**
|
|
||||||
* FIXME: To remove when j9 is fix.
|
|
||||||
* The overloading here corrects a bug in J9
|
|
||||||
* When the ring buffer when full returns 0.
|
|
||||||
*/
|
|
||||||
public synchronized int available() throws IOException {
|
|
||||||
if(in < 0 || buffer == null)
|
|
||||||
return 0;
|
|
||||||
else if(in == out)
|
|
||||||
return buffer.length;
|
|
||||||
else if (in > out)
|
|
||||||
return in - out;
|
|
||||||
else
|
|
||||||
return in + buffer.length - out;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} catch( IOException e ) {
|
} catch( IOException e ) {
|
||||||
setErrorMessage("Command canceled");
|
setErrorMessage("Command canceled");
|
||||||
return COMMAND_CANCELED;
|
return COMMAND_CANCELED;
|
||||||
|
@ -178,6 +146,7 @@ public class CommandLauncher {
|
||||||
byte buffer[] = new byte[1024];
|
byte buffer[] = new byte[1024];
|
||||||
int nbytes;
|
int nbytes;
|
||||||
while (!monitor.isCanceled() && closure.isAlive()) {
|
while (!monitor.isCanceled() && closure.isAlive()) {
|
||||||
|
nbytes = 0;
|
||||||
try {
|
try {
|
||||||
if ( errInPipe.available() > 0 ) {
|
if ( errInPipe.available() > 0 ) {
|
||||||
nbytes = errInPipe.read(buffer);
|
nbytes = errInPipe.read(buffer);
|
||||||
|
@ -192,9 +161,11 @@ public class CommandLauncher {
|
||||||
} catch( IOException e) {
|
} catch( IOException e) {
|
||||||
}
|
}
|
||||||
monitor.worked(0);
|
monitor.worked(0);
|
||||||
try {
|
if (nbytes == 0) {
|
||||||
Thread.sleep(DELAY);
|
try {
|
||||||
} catch (InterruptedException ie) {
|
Thread.sleep(DELAY);
|
||||||
|
} catch (InterruptedException ie) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue