Terminate loop explicitly on interrupted

Make explicit that the loop terminates when the current thread is
interrupted.
refactor-encoder
Romain Vimont 1 year ago
parent bdba554118
commit 74d32e612d

@ -75,7 +75,7 @@ public class Controller {
SystemClock.sleep(500);
}
while (true) {
while (!Thread.currentThread().isInterrupted()) {
handleEvent();
}
}

@ -25,7 +25,7 @@ public final class DeviceMessageSender {
}
public void loop() throws IOException, InterruptedException {
while (true) {
while (!Thread.currentThread().isInterrupted()) {
String text;
long sequence;
synchronized (this) {

Loading…
Cancel
Save