Bug 3024

Summary: No thread saftey in Mesa's libGL
Product: DRI Reporter: Ian Romanick <idr>
Component: libGLAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: high CC: roland.mainz
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Patch to use pthreads or TLS for per-thread GLX context, version 01 none

Description Ian Romanick 2005-04-13 20:29:12 UTC
The libGL built in the Mesa tree, via 'make linux-dri' and friends, is built
without XTHREADS defined.  Because of this, there is *NO* per-thread GLX
context.  Just grep for XTHREADS in src/glx/x11 for a good time. :(
Comment 1 Ian Romanick 2005-04-14 13:58:06 UTC
Created attachment 2426 [details] [review]
Patch to use pthreads or TLS for per-thread GLX context, version 01

Since everything else in the Mesa build uses either pthreads or TLS, this patch
adds similar support to libGL for the per-thread GLX context.

Also, glxext.c will give an error during compilation if THREADS is defined but
PTHREADS or XTHREADS is not.  If there are no supported platforms that don't
support multithreading, then this should be changed from '#elif defined(
THREADS )' to just '#else'.  That is, libGL will require either PTHREADS or
XTHREADS.  I personally think that is the right way to go, but that change can
be made later.

This patch also removes the dependency on GLX_DIRECT_RENDERING for per-thread
GLX context support.

If there are no objections, I will commit this to Mesa CVS on 15-Apr-2005.
Comment 2 Ian Romanick 2005-04-18 10:00:05 UTC
Fix committed to Mesa CVS.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.