summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-01-31 15:01:21 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-31 15:01:21 -0800
commit4a702faf5b2a871ae7766e8472ebe737c4624683 (patch)
tree7bf019420eaf4b5e41aa5ff5e0a546d6fafdec14 /opengl
parentfe86a7f64c666b86c4aedbdd159c27e1cd0d7490 (diff)
parentcf675303927d8008c5952759d534dcc6c0ca3d4a (diff)
downloadframeworks_base-4a702faf5b2a871ae7766e8472ebe737c4624683.zip
frameworks_base-4a702faf5b2a871ae7766e8472ebe737c4624683.tar.gz
frameworks_base-4a702faf5b2a871ae7766e8472ebe737c4624683.tar.bz2
am cf675303: am 8df2c424: Merge "Fix a multithreading bug in libagl\'s EGL." into honeycomb
* commit 'cf675303927d8008c5952759d534dcc6c0ca3d4a': Fix a multithreading bug in libagl's EGL.
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libagl/egl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
index 7ac6f92..a1cb23a 100644
--- a/opengl/libagl/egl.cpp
+++ b/opengl/libagl/egl.cpp
@@ -82,6 +82,11 @@ static GLint getError() {
if (ggl_unlikely(gEGLErrorKey == -1))
return EGL_SUCCESS;
GLint error = (GLint)pthread_getspecific(gEGLErrorKey);
+ if (error == 0) {
+ // The TLS key has been created by another thread, but the value for
+ // this thread has not been initialized.
+ return EGL_SUCCESS;
+ }
pthread_setspecific(gEGLErrorKey, (void*)EGL_SUCCESS);
return error;
}