Fix: racing condition with messages when the queue is full (#223)

There was a racing condition between the queue full message and *any* error message where the later are overwritten by the former.
This commit is contained in:
Luis Uguina
2020-05-11 21:51:36 +10:00
committed by GitHub
parent 18b99ded40
commit 26155a28dc
2 changed files with 10 additions and 7 deletions

View File

@@ -358,12 +358,15 @@ public class Client {
this.renderingJob = null;
}
while (this.shouldWaitBeforeRender() == true) {
try {
Thread.sleep(4000); // wait a little bit
this.gui.status("Sending frames. Please wait");
}
catch (InterruptedException e3) {
if (this.shouldWaitBeforeRender() == true) {
this.gui.status("Sending frames. Please wait");
while (this.shouldWaitBeforeRender() == true) {
try {
Thread.sleep(4000); // wait a little bit
}
catch (InterruptedException e3) {
}
}
}
this.log.removeCheckPoint(step);

View File

@@ -206,7 +206,7 @@ public class GuiSwing extends JFrame implements Gui {
@Override
public void error(String msg_) {
status(msg_);
status(msg_, true);
}
@Override