Terminate loop explicitly on interrupted
Make explicit that the loop terminates when the current thread is interrupted.
This commit is contained in:
parent
bdba554118
commit
74d32e612d
2 changed files with 2 additions and 2 deletions
|
@ -75,7 +75,7 @@ public class Controller {
|
||||||
SystemClock.sleep(500);
|
SystemClock.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (true) {
|
while (!Thread.currentThread().isInterrupted()) {
|
||||||
handleEvent();
|
handleEvent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ public final class DeviceMessageSender {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loop() throws IOException, InterruptedException {
|
public void loop() throws IOException, InterruptedException {
|
||||||
while (true) {
|
while (!Thread.currentThread().isInterrupted()) {
|
||||||
String text;
|
String text;
|
||||||
long sequence;
|
long sequence;
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
|
Loading…
Reference in a new issue