Revert "CPP-6254 Output for CLion IDE sometimes cuts off when executing a program"

This reverts commit 92e527b1a9.
This commit is contained in:
Vyacheslav Karpukhin
2016-05-12 15:10:24 +02:00
parent 22e55860aa
commit feb536346f
2 changed files with 3 additions and 18 deletions
@@ -139,8 +139,8 @@ public class BaseOSProcessHandler extends ProcessHandler implements TaskExecutor
public void consume(Integer exitCode) {
try {
// tell readers that no more attempts to read process' output should be made
stop(stdErrReader);
stop(stdOutReader);
if (stdErrReader != null) stdErrReader.stop();
stdOutReader.stop();
try {
if (stdErrReader != null) stdErrReader.waitFor();
@@ -163,17 +163,6 @@ public class BaseOSProcessHandler extends ProcessHandler implements TaskExecutor
super.startNotify();
}
private static void stop(@Nullable BaseDataReader reader) {
if (reader != null) {
if (reader instanceof BaseOutputReader) {
((BaseOutputReader)reader).stop(false);
}
else {
reader.stop();
}
}
}
/** @deprecated override {@link #createOutputDataReader()} (to be removed in IDEA 18) */
protected BaseDataReader createErrorDataReader(@SuppressWarnings("UnusedParameters") BaseDataReader.SleepingPolicy policy) {
return createErrorDataReader();
@@ -190,12 +190,8 @@ public abstract class BaseOutputReader extends BaseDataReader {
@Override
public void stop() {
stop(true);
}
public void stop(boolean force) {
super.stop();
if (force && mySleepingPolicy == SleepingPolicy.BLOCKING) {
if (mySleepingPolicy == SleepingPolicy.BLOCKING) {
// we can't count on super.stop() since it only sets 'isRunning = false', and blocked Reader.read won't wake up.
try { close(); }
catch (IOException ignore) { }