[RenderScript] Interrupt mMessageThread when tearing down context.

- Interrupt mMessageThread, so it gets to see immediately
    that mRun is false and exit rightaway.

Change-Id: Ic586ef225a5c6f3a77f89de00b7fb3f3547c9838
This commit is contained in:
Miao Wang
2016-05-10 16:44:11 -07:00
parent a5ca0ca886
commit 4a574806e6

View File

@@ -1616,6 +1616,9 @@ public class RenderScript {
nContextDeinitToClient(mContext);
mMessageThread.mRun = false;
// Interrupt mMessageThread so it gets to see immediately that mRun is false
// and exit rightaway.
mMessageThread.interrupt();
// Wait for mMessageThread to join. Try in a loop, in case this thread gets interrupted
// during the wait. If interrupted, set the "interrupted" status of the current thread.