Merge "Retry if interrupted before mMessageThread has joined"
This commit is contained in:
@@ -1574,10 +1574,17 @@ public class RenderScript {
|
|||||||
|
|
||||||
nContextDeinitToClient(mContext);
|
nContextDeinitToClient(mContext);
|
||||||
mMessageThread.mRun = false;
|
mMessageThread.mRun = false;
|
||||||
|
|
||||||
|
// Wait for mMessageThread to join. Try in a loop, in case this thread gets interrupted
|
||||||
|
// during the wait.
|
||||||
|
boolean hasJoined = false;
|
||||||
|
while (!hasJoined) {
|
||||||
try {
|
try {
|
||||||
mMessageThread.join();
|
mMessageThread.join();
|
||||||
|
hasJoined = true;
|
||||||
} catch(InterruptedException e) {
|
} catch(InterruptedException e) {
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nContextDestroy();
|
nContextDestroy();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user