egl/dri2: avoid undefined unlocks
authorJonathan Gray <jsg@jsg.id.au>
Sun, 15 Jan 2023 02:48:10 +0000 (13:48 +1100)
committerEric Engestrom <eric@engestrom.ch>
Thu, 26 Jan 2023 15:40:34 +0000 (15:40 +0000)
commit8e2e275985619988f7d84010ab525bf27f3b9a88
tree1ca015193d3b325a238be1a13dd813077e7f601b
parent16fc1641ccad15bc34dd2b77d1a91cc38ebbc444
egl/dri2: avoid undefined unlocks

unlocks were incorrectly added to paths using dri2_egl_display() as
well as those using dri2_egl_display_lock()

pthread_mutex_unlock() when unlocked is documented by posix as
being undefined behaviour.  On OpenBSD pthread_mutex_unlock() will call
abort(3) if this happens.

Fixes: f1efe037dfd ("egl/dri2: Add display lock")
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20712>
(cherry picked from commit 0594b3c143d48c5f37f705abb03f18fbbabbc6b0)
.pick_status.json
src/egl/drivers/dri2/egl_dri2.c