Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: webrtc/api/java/android/org/webrtc/EglBase.java

Issue 1848483002: Android EGL: Synchronize calls to eglSwapBuffers and eglMakeCurrent (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/api/java/android/org/webrtc/EglBase10.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/java/android/org/webrtc/EglBase.java
diff --git a/webrtc/api/java/android/org/webrtc/EglBase.java b/webrtc/api/java/android/org/webrtc/EglBase.java
index 2f3fcffee60282c08648074dc79137a66d249272..05dd8060d45c5edd347100de051010475ab4e41c 100644
--- a/webrtc/api/java/android/org/webrtc/EglBase.java
+++ b/webrtc/api/java/android/org/webrtc/EglBase.java
@@ -25,6 +25,12 @@ public abstract class EglBase {
public static class Context {
}
+ // According to the documentation, EGL can be used from multiple threads at the same time if each
+ // thread has its own EGLContext, but in practice it deadlocks on some devices when doing this.
+ // Therefore, synchronize on this global lock before calling dangerous EGL functions that might
+ // deadlock. See https://bugs.chromium.org/p/webrtc/issues/detail?id=5702 for more info.
+ public static final Object lock = new Object();
+
// These constants are taken from EGL14.EGL_OPENGL_ES2_BIT and EGL14.EGL_CONTEXT_CLIENT_VERSION.
// https://android.googlesource.com/platform/frameworks/base/+/master/opengl/java/android/opengl/EGL14.java
// This is similar to how GlSurfaceView does:
« no previous file with comments | « no previous file | webrtc/api/java/android/org/webrtc/EglBase10.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698