Fix potential deadlock caused by RenderScript
If the context is created with RS_CONTEXT_SYNCHRONOUS flag,
there is no thread to join.
Unfortunately, deadlock can occur if mThreadId has a
joinable thread ID since mThreadId is uninitialized.
Change-Id: I0315237a41d3ca33f0aa691c7de1ae29d2c02b57
diff --git a/rsContext.cpp b/rsContext.cpp
index 916c6a0..290a090 100644
--- a/rsContext.cpp
+++ b/rsContext.cpp
@@ -608,7 +608,9 @@
void *res;
mIO.shutdown();
- int status = pthread_join(mThreadId, &res);
+ if (!mSynchronous) {
+ pthread_join(mThreadId, &res);
+ }
rsAssert(mExit);
if (mHal.funcs.shutdownDriver) {