From 7f110ec63dfc28a2993b532c1b22656ac1121ad7 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sat, 4 Nov 2023 12:02:54 +0100 Subject: [PATCH] rusticl/gl: mark GLCtxManager as Send + Sync Signed-off-by: Karol Herbst Part-of: --- src/gallium/frontends/rusticl/core/gl.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/frontends/rusticl/core/gl.rs b/src/gallium/frontends/rusticl/core/gl.rs index 09c40ba7f9e..f4b83865352 100644 --- a/src/gallium/frontends/rusticl/core/gl.rs +++ b/src/gallium/frontends/rusticl/core/gl.rs @@ -137,6 +137,13 @@ pub struct GLCtxManager { gl_ctx: GLCtx, } +// SAFETY: We do have a few pointers inside [GLCtxManager], but nothing really relevant here: +// * pointers of the GLX/EGL context and _XDisplay/EGLDisplay, but we don't do much with them +// except calling into our mesa internal GL sharing extension, which properly locks data. +// * pointer to the _XDisplay/EGLDisplay +unsafe impl Send for GLCtxManager {} +unsafe impl Sync for GLCtxManager {} + impl GLCtxManager { pub fn new( gl_context: *mut c_void,