Lines 636-642
Link Here
|
636 |
colorMap.put(Color.white, 37); |
636 |
colorMap.put(Color.white, 37); |
637 |
} |
637 |
} |
638 |
|
638 |
|
639 |
void dispose() { |
639 |
synchronized void dispose() { |
640 |
if (outputWriter != null) { |
640 |
if (outputWriter != null) { |
641 |
// LATER outputWriter.dispose(); |
641 |
// LATER outputWriter.dispose(); |
642 |
outputWriter = null; |
642 |
outputWriter = null; |
Lines 676-691
Link Here
|
676 |
* @return the writer. |
676 |
* @return the writer. |
677 |
*/ |
677 |
*/ |
678 |
@Override |
678 |
@Override |
679 |
public OutputWriter getOut() { |
679 |
public synchronized OutputWriter getOut() { |
680 |
// Ensure we don't get two of them due to requests on |
680 |
// Ensure we don't get two of them due to requests on |
681 |
// different threads. |
681 |
// different threads. |
682 |
synchronized (this) { |
682 |
if (outputWriter == null) { |
683 |
if (outputWriter == null) { |
683 |
ValueTask<Writer> task = new Task.GetOut(terminal); |
684 |
ValueTask<Writer> task = new Task.GetOut(terminal); |
684 |
task.post(); |
685 |
task.post(); |
685 |
Writer writer = task.get(); |
686 |
Writer writer = task.get(); |
686 |
outputWriter = new TermOutputWriter(terminal, writer); |
687 |
outputWriter = new TermOutputWriter(terminal, writer); |
|
|
688 |
} |
689 |
} |
687 |
} |
690 |
terminal.setOutConnected(true); |
688 |
terminal.setOutConnected(true); |
691 |
return outputWriter; |
689 |
return outputWriter; |
Lines 705-728
Link Here
|
705 |
* pre-combine stderr and stdout. |
703 |
* pre-combine stderr and stdout. |
706 |
*/ |
704 |
*/ |
707 |
@Override |
705 |
@Override |
708 |
public OutputWriter getErr() { |
706 |
public synchronized OutputWriter getErr() { |
709 |
// Ensure we don't get two of them due to requests on |
707 |
// Ensure we don't get two of them due to requests on |
710 |
// different threads. |
708 |
// different threads. |
711 |
synchronized (this) { |
709 |
// workaround for #182063: - UnsupportedOperationException |
712 |
// workaround for #182063: - UnsupportedOperationException |
710 |
if (errWriter == null) { |
713 |
if (errWriter == null) { |
711 |
ValueTask<Writer> task = new Task.GetOut(terminal); |
714 |
ValueTask<Writer> task = new Task.GetOut(terminal); |
712 |
task.post(); |
715 |
task.post(); |
713 |
Writer writer = task.get(); |
716 |
Writer writer = task.get(); |
714 |
errWriter = new TermErrWriter(terminal, writer); |
717 |
errWriter = new TermErrWriter(terminal, writer); |
|
|
718 |
} |
719 |
} |
715 |
} |
720 |
terminal.setErrConnected(true); |
716 |
terminal.setErrConnected(true); |
721 |
return errWriter; |
717 |
return errWriter; |
722 |
} |
718 |
} |
723 |
|
719 |
|
724 |
@Override |
720 |
@Override |
725 |
public void closeInputOutput() { |
721 |
public synchronized void closeInputOutput() { |
726 |
// Need to remove it from IOProvider first, doing that from EDT is loo late |
722 |
// Need to remove it from IOProvider first, doing that from EDT is loo late |
727 |
// because we may issue another getIO from the same thread (IZ 199441) |
723 |
// because we may issue another getIO from the same thread (IZ 199441) |
728 |
TerminalIOProvider.remove(this); |
724 |
TerminalIOProvider.remove(this); |