1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

Send a synchronization notify immediately for commands

wit no tokens.
This commit is contained in:
Alain Magloire 2002-09-07 14:49:09 +00:00
parent 42e4cbf928
commit 5c8cdfbd11

View file

@ -29,7 +29,8 @@ public class TxThread extends Thread {
public void run () {
try {
// signal by the session of time to die.
while (session.getChannelOutputStream() != null) {
OutputStream out;
while ((out = session.getChannelOutputStream()) != null) {
Command cmd = null;
CommandQueue txQueue = session.getTxQueue();
// removeCommand() will block until a command is available.
@ -48,10 +49,14 @@ public class TxThread extends Thread {
if (cmd.getToken() > 0) {
CommandQueue rxQueue = session.getRxQueue();
rxQueue.addCommand(cmd);
} else {
synchronized (cmd) {
cmd.notifyAll();
}
}
// shove in the pipe
String str = cmd.toString();
OutputStream out = session.getChannelOutputStream();
if (out != null) {
out.write(str.getBytes());
out.flush();