Bug 1061435 - Set timeout to fClientWaitSync() r=nical
authorSotaro Ikeda <sikeda@mozilla.com>
Wed, 24 Sep 2014 07:00:19 -0700
changeset 222488 587112ab2e73c3a67477c723261b1308eb47121a
parent 222487 03b1abc4f5e7854a77359558d0c5d8c30b1c743a
child 222489 6c5cf0e394adf47d7a578c425510aa6bb42fa306
push id7107
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 17:43:31 +0000
treeherdermozilla-aurora@b4b34e0acc75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1061435
milestone35.0a1
Bug 1061435 - Set timeout to fClientWaitSync() r=nical
gfx/layers/opengl/TextureHostOGL.cpp
--- a/gfx/layers/opengl/TextureHostOGL.cpp
+++ b/gfx/layers/opengl/TextureHostOGL.cpp
@@ -261,22 +261,25 @@ TextureHostOGL::WaitAcquireFenceSyncComp
   EGLSync sync = sEGLLibrary.fCreateSync(EGL_DISPLAY(),
                                          LOCAL_EGL_SYNC_NATIVE_FENCE_ANDROID,
                                          attribs);
   if (!sync) {
     NS_WARNING("failed to create native fence sync");
     return;
   }
 
+  // Wait sync complete with timeout.
+  // If a source of the fence becomes invalid because of error,
+  // fene complete is not signaled. See Bug 1061435.
   EGLint status = sEGLLibrary.fClientWaitSync(EGL_DISPLAY(),
                                               sync,
                                               0,
-                                              LOCAL_EGL_FOREVER);
+                                              400000000 /*400 usec*/);
   if (status != LOCAL_EGL_CONDITION_SATISFIED) {
-    NS_WARNING("failed to wait native fence sync");
+    NS_ERROR("failed to wait native fence sync");
   }
   MOZ_ALWAYS_TRUE( sEGLLibrary.fDestroySync(EGL_DISPLAY(), sync) );
   mAcquireFence = nullptr;
 }
 
 #endif
 
 bool