Subject: Re: Mesa now uses pthread_mutex_init(): link against libpthread?
To: Blair Sadewitz <>
From: Matthias Drochner <>
List: tech-pkg
Date: 08/16/2007 21:41:50 said:
> It seems now that they're actually using locking now, and thus libGL
> is no longer merely thread-safe.

I'd say that use of proper locking is an important part of being
thread-safe. And for libraries not spawning threads by itself
it should be almost sufficient.
The libc pthread wrapper functions should deal with this; there
is still no need to link libGL against libpthread. (And the
Xserver also doesn't use threads, nor does any of the runtime
loaded modules afaict.)

> Of course, I could just let it use the no-op stubs, but I'd like to
> take advantage of this, as the locks added thusfar are for stability's
> sake, AFAIK.

Linking against libpthread doesn't give any stability. It is
necessary if threads are created, but it has some side effects,
like breaking sigaltstack, which make it advisable to avoid it
unless really necessary.

I've just built your new mesa and xserver from -wip, with
the -lpthread patches out, and it works as well as before.
(I'm suffering from the "pointer sticks to the left side"
syndrome -- do you know where this comes from?)

best regards

Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDirig'in Baerbel Brumme-Bothe
Vorstand: Prof. Dr. Achim Bachem (Vorsitzender), Dr. Ulrich Krafft (stellv.