Avoid accessing TLS in rsClearObject()
Bug: 27874893
Bug: 27925095
rsClearObject() may be called on rsContextDestroy() in the JNI thread,
where TLS is not initialized.
This also reverted Icca50fade1199b6f530f963e9e694366b7d8cf67 that
made rsContextDestroy() go through the FIFO. rsContextDestroy() must
happen off the FIFO, since it joins the FIFO consuming thread.
Both the rsClearObject() change and the rsContextDestroy() revert need
to go together to make RenderScript and Camera CTS tests pass. Hence
this single CL for both changes.
Change-Id: I5f1d91a4cc1ce9bf2b3386fbef6f1171638b5266
(cherry picked from commit ade3137c22dd91694742145c2d5fe9d6bae17516)
diff --git a/cpu_ref/rsCpuExecutable.cpp b/cpu_ref/rsCpuExecutable.cpp
index 1a0e70e..9d6e623 100644
--- a/cpu_ref/rsCpuExecutable.cpp
+++ b/cpu_ref/rsCpuExecutable.cpp
@@ -300,7 +300,7 @@
}
ScriptExecutable* ScriptExecutable::createFromSharedObject(
- Context* RSContext, void* sharedObj, uint32_t expectedChecksum) {
+ void* sharedObj, uint32_t expectedChecksum) {
char line[MAXLINE];
size_t varCount = 0;
@@ -721,7 +721,7 @@
}
return new ScriptExecutable(
- RSContext, fieldAddress, fieldIsObject, fieldName, varCount,
+ fieldAddress, fieldIsObject, fieldName, varCount,
invokeFunctions, funcCount,
forEachFunctions, forEachSignatures, forEachCount,
reduceFunctions, reduceCount,