From abdabd9c3c199ab0b402234d4a4ae6e3fd42445e Mon Sep 17 00:00:00 2001 From: Andy2 Date: Fri, 4 Mar 2011 07:19:06 -0800 Subject: [PATCH] don't pass timeout value to join() when stopping jni thread. If the timeout fires there's nothing I can do anyway. So it it take as long as required to exit run(), and if that's too long fix it. --- .../XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java index 979c1e708..5fee38de6 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java @@ -127,7 +127,12 @@ public class JNIThread extends Thread { m_stopped = true; handle( JNICmd.CMD_NONE ); // tickle it try { - join(200); // wait up to 2/10 second + // Can't pass timeout to join. There's no way to kill + // this thread unless it's doing something interruptable + // (like blocking on a socket) so might as well let it + // take however log it takes. If that's too long, fix it. + join(); + // Assert.assertFalse( isAlive() ); } catch ( java.lang.InterruptedException ie ) { Utils.logf( "got InterruptedException: " + ie.toString() ); }