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.
This commit is contained in:
Jamie Gennis
2011-01-31 15:01:21 -08:00
committed by Android Git Automerger

View File

@@ -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;
}