egl: Introduce rwlock to protect eglTerminate()
eglTerminate() must be serialized against all other EGL calls. But in
most cases, other EGL calls do not need to be serialized against each
other. Which fits rather well with a rwlock.
One would be tempted to simply replace the existing BDL with a rwlock,
but several portability and debuggability limitations of the rwlock
implementation prevent that, as described in the TerminateLock comment
block.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18050>