egl: Introduce rwlock to protect eglTerminate()
authorRob Clark <robdclark@chromium.org>
Mon, 29 Aug 2022 17:28:11 +0000 (10:28 -0700)
committerRob Clark <robdclark@chromium.org>
Thu, 8 Sep 2022 04:21:34 +0000 (21:21 -0700)
commit5d99e8cc0322aa9132826cbfe00e9525790a8b5d
tree285d72e91dc22ac73fd07ca0ade3933bd8a85d07
parent7ba2784b0a4bbed36a75488d4b73a314aafaedf1
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>
src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/wgl/egl_wgl.c
src/egl/main/eglapi.c
src/egl/main/egldisplay.c
src/egl/main/egldisplay.h