Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
[fw/altos] / altoslib / AltosIdleMonitor.java
index d858845a1af0dbe0ea10837191cfa053507439d7..d9d71143a0f5f4fea10ea535e00498fcc5e2fdd6 100644 (file)
@@ -90,15 +90,13 @@ public class AltosIdleMonitor extends Thread {
                link.abort_reply();
        }
 
-       public void abort() {
-               if (isAlive()) {
+       public void abort() throws InterruptedException {
+               while (isAlive()) {
                        interrupt();
                        link.abort_reply();
-                       try {
-                               join();
-                       } catch (InterruptedException ie) {
-                       }
+                       Thread.sleep(100);
                }
+               join();
        }
 
        public void run() {
@@ -115,7 +113,10 @@ public class AltosIdleMonitor extends Thread {
                        }
                } catch (InterruptedException ie) {
                }
-               link.close();
+               try {
+                       link.close();
+               } catch (InterruptedException ie) {
+               }
        }
 
        public AltosIdleMonitor(AltosIdleMonitorListener in_listener, AltosLink in_link, boolean in_remote)