summaryrefslogtreecommitdiffstats
path: root/rs
diff options
context:
space:
mode:
Diffstat (limited to 'rs')
-rw-r--r--rs/java/android/renderscript/RenderScript.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java
index 8b1a032..62ddc39 100644
--- a/rs/java/android/renderscript/RenderScript.java
+++ b/rs/java/android/renderscript/RenderScript.java
@@ -1557,9 +1557,16 @@ public class RenderScript {
nContextDeinitToClient(mContext);
mMessageThread.mRun = false;
- try {
- mMessageThread.join();
- } catch(InterruptedException e) {
+
+ // Wait for mMessageThread to join. Try in a loop, in case this thread gets interrupted
+ // during the wait.
+ boolean hasJoined = false;
+ while (!hasJoined) {
+ try {
+ mMessageThread.join();
+ hasJoined = true;
+ } catch(InterruptedException e) {
+ }
}
nContextDestroy();