mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 03:53:21 +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 () {
|
public void run () {
|
||||||
try {
|
try {
|
||||||
// signal by the session of time to die.
|
// signal by the session of time to die.
|
||||||
while (session.getChannelOutputStream() != null) {
|
OutputStream out;
|
||||||
|
while ((out = session.getChannelOutputStream()) != null) {
|
||||||
Command cmd = null;
|
Command cmd = null;
|
||||||
CommandQueue txQueue = session.getTxQueue();
|
CommandQueue txQueue = session.getTxQueue();
|
||||||
// removeCommand() will block until a command is available.
|
// removeCommand() will block until a command is available.
|
||||||
|
@ -48,10 +49,14 @@ public class TxThread extends Thread {
|
||||||
if (cmd.getToken() > 0) {
|
if (cmd.getToken() > 0) {
|
||||||
CommandQueue rxQueue = session.getRxQueue();
|
CommandQueue rxQueue = session.getRxQueue();
|
||||||
rxQueue.addCommand(cmd);
|
rxQueue.addCommand(cmd);
|
||||||
|
} else {
|
||||||
|
synchronized (cmd) {
|
||||||
|
cmd.notifyAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// shove in the pipe
|
// shove in the pipe
|
||||||
String str = cmd.toString();
|
String str = cmd.toString();
|
||||||
OutputStream out = session.getChannelOutputStream();
|
|
||||||
if (out != null) {
|
if (out != null) {
|
||||||
out.write(str.getBytes());
|
out.write(str.getBytes());
|
||||||
out.flush();
|
out.flush();
|
||||||
|
|
Loading…
Add table
Reference in a new issue