Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8bf9429 authored by Jason Sams's avatar Jason Sams
Browse files

Fix race condition on exit.

Change-Id: I1ae1818122604dde5993b2b8ef702bda5194d87d
parent ec7291c9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -608,7 +608,7 @@ public class RenderScript {
            while(mRun) {
                rbuf[0] = 0;
                int msg = mRS.nContextGetMessage(mRS.mContext, rbuf, true);
                if (msg == 0) {
                if ((msg == 0) && mRun) {
                    // Can happen for two reasons
                    if (rbuf[0] > 0) {
                        // 1: Buffer needs to be enlarged.
@@ -661,6 +661,10 @@ public class RenderScript {
        validate();
        nContextDeinitToClient(mContext);
        mMessageThread.mRun = false;
        try {
            mMessageThread.join();
        } catch(InterruptedException e) {
        }

        nContextDestroy();
        mContext = 0;