summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/SurfaceFlinger.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-07-25 21:12:12 -0700
committerMathias Agopian <mathias@google.com>2012-07-25 21:13:10 -0700
commit028508cad5ef63ef9fbd42c14e76658e4fd9ebf2 (patch)
treeff611b4577a59d6314fb5369477d4356da0f223a /services/surfaceflinger/SurfaceFlinger.cpp
parent8630320433bd15aca239522e54e711ef6372ab07 (diff)
downloadframeworks_native-028508cad5ef63ef9fbd42c14e76658e4fd9ebf2.zip
frameworks_native-028508cad5ef63ef9fbd42c14e76658e4fd9ebf2.tar.gz
frameworks_native-028508cad5ef63ef9fbd42c14e76658e4fd9ebf2.tar.bz2
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
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp8
1 files changed, 4 insertions, 4 deletions
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 @@ status_t SurfaceFlinger::readyToRun()
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 @@ status_t SurfaceFlinger::readyToRun()
mHwc->setFrameBuffer(display, surface);
}
- // start the EventThread
- mEventThread = new EventThread(this);
- mEventQueue.setEventThread(mEventThread);
-
// We're now ready to accept clients...
mReadyToRunBarrier.open();