mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Do not pass an empty string.
This commit is contained in:
parent
0dc064bbd6
commit
e2482f2bc6
1 changed files with 26 additions and 17 deletions
|
@ -41,28 +41,37 @@ public class TxThread extends Thread {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd != null) {
|
if (cmd != null) {
|
||||||
// Move to the RxQueue only if RxThread is alive.
|
String str = cmd.toString();
|
||||||
Thread rx = session.getRxThread();
|
// if string is empty consider as a noop
|
||||||
if (rx != null && rx.isAlive()) {
|
if (str.length() > 0) {
|
||||||
CommandQueue rxQueue = session.getRxQueue();
|
// Move to the RxQueue only if RxThread is alive.
|
||||||
rxQueue.addCommand(cmd);
|
Thread rx = session.getRxThread();
|
||||||
|
if (rx != null && rx.isAlive()) {
|
||||||
|
CommandQueue rxQueue = session.getRxQueue();
|
||||||
|
rxQueue.addCommand(cmd);
|
||||||
|
} else {
|
||||||
|
// The RxThread is not running
|
||||||
|
synchronized (cmd) {
|
||||||
|
cmd.notifyAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process the Command line to recognise patterns we may need to fire event.
|
||||||
|
if (cmd instanceof CLICommand) {
|
||||||
|
cli.process((CLICommand)cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
// shove in the pipe
|
||||||
|
if (out != null) {
|
||||||
|
out.write(str.getBytes());
|
||||||
|
out.flush();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// String is empty consider as a noop
|
||||||
synchronized (cmd) {
|
synchronized (cmd) {
|
||||||
cmd.notifyAll();
|
cmd.notifyAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// May need to fire event.
|
|
||||||
if (cmd instanceof CLICommand) {
|
|
||||||
cli.process((CLICommand)cmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
// shove in the pipe
|
|
||||||
String str = cmd.toString();
|
|
||||||
if (out != null && str.length() > 0) {
|
|
||||||
out.write(str.getBytes());
|
|
||||||
out.flush();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue