From 5c8cdfbd11798da944e8bd503ef9d0cb1acc6984 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Sat, 7 Sep 2002 14:49:09 +0000 Subject: [PATCH] Send a synchronization notify immediately for commands wit no tokens. --- .../src/org/eclipse/cdt/debug/mi/core/TxThread.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/TxThread.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/TxThread.java index ab8acbc7b27..ac60f9fff1b 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/TxThread.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/TxThread.java @@ -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();