diff options
author | Keith Packard <keithp@keithp.com> | 2013-12-18 01:14:11 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-12-18 01:14:11 -0800 |
commit | e26306c9350ef1d107d4257ef1c09d15165c9154 (patch) | |
tree | d7983c6a04c54b3307d6fc2699dad4fa21d8bde0 /altoslib/AltosIgnite.java | |
parent | 18852efa108ba6e6e69dfd5076d4f4c01f62b4ef (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 'altoslib/AltosIgnite.java')
-rw-r--r-- | altoslib/AltosIgnite.java | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/altoslib/AltosIgnite.java b/altoslib/AltosIgnite.java index 42169989..fc9599b6 100644 --- a/altoslib/AltosIgnite.java +++ b/altoslib/AltosIgnite.java @@ -141,7 +141,7 @@ public class AltosIgnite { } } - public void fire(int igniter) { + public void fire(int igniter) throws InterruptedException { if (link == null) return; try { @@ -154,21 +154,14 @@ public class AltosIgnite { link.printf("i DoIt drogue\n"); break; } - } catch (InterruptedException ie) { } catch (TimeoutException te) { } finally { - try { - stop_link(); - } catch (InterruptedException ie) { - } + stop_link(); } } - public void close() { - try { - stop_link(); - } catch (InterruptedException ie) { - } + public void close() throws InterruptedException { + stop_link(); link.close(); link = null; } |