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
8 files changed
tree: b6e201f129099aba240e6f19c715f08aa6776eed
  1. Android.mk
  2. CleanSpec.mk
  3. api/
  4. cpp/
  5. cpu_ref/
  6. driver/
  7. java/
  8. libRS.map
  9. rs.h
  10. rs.spec
  11. rsAllocation.cpp
  12. rsAllocation.h
  13. rsAnimation.cpp
  14. rsAnimation.h
  15. rsApiAllocation.cpp
  16. rsApiContext.cpp
  17. rsApiDevice.cpp
  18. rsApiElement.cpp
  19. rsApiFileA3D.cpp
  20. rsApiMesh.cpp
  21. rsApiType.cpp
  22. rsClosure.cpp
  23. rsClosure.h
  24. rsCompatibilityLib.cpp
  25. rsCompatibilityLib.h
  26. rsComponent.cpp
  27. rsComponent.h
  28. rsContext.cpp
  29. rsContext.h
  30. rsCppUtils.cpp
  31. rsCppUtils.h
  32. rsDebugHelper.h
  33. rsDefines.h
  34. rsDevice.cpp
  35. rsDevice.h
  36. rsDriverLoader.cpp
  37. rsElement.cpp
  38. rsElement.h
  39. rsEnv.h
  40. rsFBOCache.cpp
  41. rsFBOCache.h
  42. rsFifo.h
  43. rsFifoSocket.cpp
  44. rsFifoSocket.h
  45. rsFileA3D.cpp
  46. rsFileA3D.h
  47. rsFont.cpp
  48. rsFont.h
  49. rsGrallocConsumer.cpp
  50. rsGrallocConsumer.h
  51. rsInternalDefines.h
  52. rsList.h
  53. rsMap.h
  54. rsMatrix2x2.cpp
  55. rsMatrix2x2.h
  56. rsMatrix3x3.cpp
  57. rsMatrix3x3.h
  58. rsMatrix4x4.cpp
  59. rsMatrix4x4.h
  60. rsMesh.cpp
  61. rsMesh.h
  62. rsMutex.cpp
  63. rsMutex.h
  64. rsObjectBase.cpp
  65. rsObjectBase.h
  66. rsProgram.cpp
  67. rsProgram.h
  68. rsProgramBase.h
  69. rsProgramFragment.cpp
  70. rsProgramFragment.h
  71. rsProgramRaster.cpp
  72. rsProgramRaster.h
  73. rsProgramStore.cpp
  74. rsProgramStore.h
  75. rsProgramVertex.cpp
  76. rsProgramVertex.h
  77. rsRuntime.h
  78. rsSampler.cpp
  79. rsSampler.h
  80. rsScript.cpp
  81. rsScript.h
  82. rsScriptC.cpp
  83. rsScriptC.h
  84. rsScriptC_Lib.cpp
  85. rsScriptC_LibGL.cpp
  86. rsScriptGroup.cpp
  87. rsScriptGroup.h
  88. rsScriptGroup2.cpp
  89. rsScriptGroup2.h
  90. rsScriptGroupBase.h
  91. rsScriptIntrinsic.cpp
  92. rsScriptIntrinsic.h
  93. rsSignal.cpp
  94. rsSignal.h
  95. rsStream.cpp
  96. rsStream.h
  97. rsThreadIO.cpp
  98. rsThreadIO.h
  99. rsType.cpp
  100. rsType.h
  101. rsUtils.h
  102. rs_compat.spec
  103. rs_hal.h
  104. rsg.spec
  105. rsgApi.cpp.rsg
  106. rsgApiFuncDecl.h.rsg
  107. rsgApiReplay.cpp.rsg
  108. rsgApiStructs.h.rsg
  109. rsg_generator.c
  110. run_rs_cts.sh
  111. scriptc/
  112. server/
  113. spec.h
  114. spec.l
  115. tests/
  116. update_rs_prebuilts.sh