diff options
author | Jamie Gennis <jgennis@google.com> | 2011-01-31 13:38:27 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-31 13:38:27 -0800 |
commit | 8df2c42413cfdde1c4290b4797a09c4bafb6c3bc (patch) | |
tree | 65bf89c14a83520afb760c1694d354bf1b63a2c1 | |
parent | e9da0c1de179e3cdb2d3709bde2b5cb6eb192230 (diff) | |
parent | ae2aa286af67f7990486ca6476e73f677c58872b (diff) | |
download | frameworks_base-8df2c42413cfdde1c4290b4797a09c4bafb6c3bc.zip frameworks_base-8df2c42413cfdde1c4290b4797a09c4bafb6c3bc.tar.gz frameworks_base-8df2c42413cfdde1c4290b4797a09c4bafb6c3bc.tar.bz2 |
Merge "Fix a multithreading bug in libagl's EGL." into honeycomb
-rw-r--r-- | opengl/libagl/egl.cpp | 5 |
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; } |