Merge "Retry if interrupted before mMessageThread has joined"

This commit is contained in:
Pirama Arumuga Nainar
2015-10-02 21:58:50 +00:00
committed by Gerrit Code Review

View File

@ -1574,9 +1574,16 @@ public class RenderScript {
nContextDeinitToClient(mContext); nContextDeinitToClient(mContext);
mMessageThread.mRun = false; mMessageThread.mRun = false;
try {
mMessageThread.join(); // Wait for mMessageThread to join. Try in a loop, in case this thread gets interrupted
} catch(InterruptedException e) { // during the wait.
boolean hasJoined = false;
while (!hasJoined) {
try {
mMessageThread.join();
hasJoined = true;
} catch(InterruptedException e) {
}
} }
nContextDestroy(); nContextDestroy();