am ca3e5aea: Merge "Retry if interrupted before mMessageThread has joined"

* commit 'ca3e5aeaa65ae1d77ce92f082ab789933eb18237':
  Retry if interrupted before mMessageThread has joined
This commit is contained in:
Pirama Arumuga Nainar
2015-10-02 22:08:11 +00:00
committed by Android Git Automerger

View File

@@ -1583,9 +1583,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();