hopefully fixe a race condition in sf initialization
if we received a vsync event during SF init, we could crash
as not all objects were ready to go.
Change-Id: Ie11b46e3eb1b37a709dd8757843d444f93dd0189
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 2ecdeb8..992c779 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -406,6 +406,10 @@
EGLSurface surface = hw->getEGLSurface();
initializeGL(display, surface);
+ // start the EventThread
+ mEventThread = new EventThread(this);
+ mEventQueue.setEventThread(mEventThread);
+
// initialize the H/W composer
mHwc = new HWComposer(this,
*static_cast<HWComposer::EventHandler *>(this),
@@ -414,10 +418,6 @@
mHwc->setFrameBuffer(display, surface);
}
- // start the EventThread
- mEventThread = new EventThread(this);
- mEventQueue.setEventThread(mEventThread);
-
// We're now ready to accept clients...
mReadyToRunBarrier.open();