[Piglit] [PATCH 1/2] glx: Replace extra mutexes with XInitThreads

Eric Anholt eric at anholt.net
Mon Nov 19 13:26:01 PST 2012


Paul Berry <stereotype441 at gmail.com> writes:

> From: Ian Romanick <ian.d.romanick at intel.com>
>
> To use multithreading with xlib, you're supposed to call XInitThreads
> before any other xlib call.  Without this, xlib and GLX calls won't be
> thread safe.  It looks like this test had an extra mutex to work
> around the lack of thread saftey in glXCreateContext and
> glXMakeCurrent.

I don't think that was the intent behind the mutexes -- really just
wanted the two rendering threads to be totally serialized.  If we wanted
to test threads doing simultaneous drawing, we would probably want to do
drawing in a loop and hopefully get the two threads started at the same
time.

That said, we should definitely use XInitThreads().
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20121119/6ddbf4c8/attachment.pgp>


More information about the Piglit mailing list