summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-01-31 13:56:28 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-31 13:56:28 -0800
commitcf675303927d8008c5952759d534dcc6c0ca3d4a (patch)
tree77e0f9e0de4fe8d55c7c01556b41986eefe514e1 /opengl
parent723453a7a77180b47720d3b5e8a9752349b77e2f (diff)
parent8df2c42413cfdde1c4290b4797a09c4bafb6c3bc (diff)
downloadframeworks_base-cf675303927d8008c5952759d534dcc6c0ca3d4a.zip
frameworks_base-cf675303927d8008c5952759d534dcc6c0ca3d4a.tar.gz
frameworks_base-cf675303927d8008c5952759d534dcc6c0ca3d4a.tar.bz2
am 8df2c424: Merge "Fix a multithreading bug in libagl\'s EGL." into honeycomb
* commit '8df2c42413cfdde1c4290b4797a09c4bafb6c3bc': 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;
}