glx: add fail check for current context in another thread
authorIllia Polishchuk <illia.a.polishchuk@globallogic.com>
Tue, 25 Apr 2023 08:42:20 +0000 (11:42 +0300)
committerMarge Bot <emma+marge@anholt.net>
Wed, 26 Apr 2023 00:20:08 +0000 (00:20 +0000)
commit45ea17d2449576ffc1bf3c602d679c77dd63f39f
tree56195dbd3dbdfc394a2463427e249dd1284de403
parent2795cf7422d4246a0b514975c8f7099271287466
glx: add fail check for current context in another thread

The GLX spec for glXMakeCurrent (3.3):
"If ctx is current to some other thread, then glXMakeCurrent will generate
a BadAccess error"

The GLX spec for glXCopyContext (3.3):
"If the destination context is current for some thread then a BadAccess
error is generated"

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7961
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22546>
src/glx/glxcmds.c
src/glx/glxcurrent.c