[RenderEngine] Reorder when ImageManager thread starts
Previously the background thread for managing EglImages was intialized
as a member variable before the constructor completed running. In very
rare circumstances this can potentially stop the running thread if the
thread ran before mRunning was initialized. To be less error-prone,
require that ImageManger::initThread be explicitly called to guarantee
that class member variables are well-defined when the thread begins
executing.
In case the issue resurfaces after this change, added a debug log to add
context.
Bug: 146416748
Bug: 155852355
Test: builds. There is no reliable repro, so this fix is speculative
Test: systrace to verify thread is running and configured correctly.
Change-Id: I141c86240b90c7f87c22b3768c2e188293987b76
Merged-In: I141c86240b90c7f87c22b3768c2e188293987b76
diff --git a/libs/renderengine/gl/GLESRenderEngine.cpp b/libs/renderengine/gl/GLESRenderEngine.cpp
index d2a7525..2b83a28 100644
--- a/libs/renderengine/gl/GLESRenderEngine.cpp
+++ b/libs/renderengine/gl/GLESRenderEngine.cpp
@@ -424,6 +424,7 @@
mFlushTracer = std::make_unique<FlushTracer>(this);
}
mImageManager = std::make_unique<ImageManager>(this);
+ mImageManager->initThread();
mDrawingBuffer = createFramebuffer();
}