Merge "[RenderScript] Interrupt mMessageThread when tearing down context." am: 9f2a1979a7

am: b02f7b0a0e

* commit 'b02f7b0a0e17ac97184e113ea527145a302f8bbc':
  [RenderScript] Interrupt mMessageThread when tearing down context.

Change-Id: Icc19c3d04f3b33f928ef6f61b4a42471d51736b5
This commit is contained in:
Miao Wang
2016-05-11 19:32:00 +00:00
committed by android-build-merger

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.