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:
parent
42e4cbf928
commit
5c8cdfbd11
1 changed files with 7 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue