https://bugs.webkit.org/show_bug.cgi?id=228240
rdar://79504783
Reviewed by Ken Russell and Geoff Garen.
Apple's dyld has a bug where thread_local variables are dirtied on
process launch, causing a memory regression. Work around this
temporarily in ANGLE by using pthread thread local storage.
I don't expect this to be upstreamed to ANGLE unless they
want it. If it isn't, this patch will have to be applied until
the dyld bug is fixed.
* src/libANGLE/Context.cpp: Implement some methods to get/set what was
the global variable gCurrentValidContext.
(gl::GetCurrentValidContextTLSIndex):
(gl::GetCurrentValidContextTLS):
(gl::SetCurrentValidContextTLS):
(gl::Context::setContextLost):
* src/libANGLE/Context.h:
* src/libGLESv2/global_state.cpp: Ditto, but for gCurrentThread.
(egl::GetCurrentThreadTLSIndex):
(egl::GetCurrentThreadTLS):
(egl::SetCurrentThreadTLS):
(egl::GetCurrentThread):
(egl::SetContextCurrent):
* src/libGLESv2/global_state.h:
(gl::GetGlobalContext):
(gl::GetValidGlobalContext):
Canonical link: https://commits.webkit.org/239996@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280349 268f45cc-cd09-0410-ab3c-d52691b4dbfc