summaryrefslogtreecommitdiff
path: root/altosui/AltosFlashUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-12-18 01:14:11 -0800
committerKeith Packard <keithp@keithp.com>2013-12-18 01:14:11 -0800
commite26306c9350ef1d107d4257ef1c09d15165c9154 (patch)
treed7983c6a04c54b3307d6fc2699dad4fa21d8bde0 /altosui/AltosFlashUI.java
parent18852efa108ba6e6e69dfd5076d4f4c01f62b4ef (diff)
altoslib: Pass InterruptedException up the stack instead of hiding it
When interrupting a thread that is talking to a serial device, it's important not to have that thread discard the InterruptedException so that it will actually terminate. This patch removes a bunch of places that were discarding InterruptedExceptions and lets higher level code see them so that they can exit cleanly. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosFlashUI.java')
-rw-r--r--altosui/AltosFlashUI.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/altosui/AltosFlashUI.java b/altosui/AltosFlashUI.java
index e305d458..296ad8ef 100644
--- a/altosui/AltosFlashUI.java
+++ b/altosui/AltosFlashUI.java
@@ -365,7 +365,7 @@ public class AltosFlashUI
flash_task flasher;
- private boolean open_device() {
+ private boolean open_device() throws InterruptedException {
try {
link = new AltosSerial(device);
if (is_pair_programmed())
@@ -408,8 +408,12 @@ public class AltosFlashUI
return;
if (!select_source_file())
return;
- if (!open_device())
+ try {
+ if (!open_device())
+ return;
+ } catch (InterruptedException ie) {
return;
+ }
build_dialog();
flash_task f = new flash_task(this);
}