[Xcb] Adding pthread stubs into libxcb

Jamey Sharp jamey at minilop.net
Tue Nov 7 15:58:34 PST 2006


On Tue, Nov 07, 2006 at 09:21:15PM +0100, Diego 'Flameeyes' Pettenò wrote:
> On Tuesday 07 November 2006 20:12, Eric Anholt wrote:
> > I believe I fixed this bug yesterday.
> 
> Yes, now working with GIT version, both fluxbox (non-threaded) and KDE 
> (threaded) works as intended.

Hooray!

> Some testing for the patch will certainly help... I was thinking about using 
> the same conditional as libX11, but that is what broke FreeBSD (phtread 
> functions have weak aliases in libc, so it missed the thrstubs, but one 
> function at least is missing: pthread_equal). Although it's a bit of 
> overhead, at this point it would be simpler to leave the stubs there and be 
> done with it.

I'm not absolutely sure we'll get correct behavior cross-platform if we
always include the stubs. If nothing else, I don't know that this code
will work with non-GCC compilers that currently have no problem with
XCB; but besides that, I'm not sure how the many different linkers in
the world treat weak symbols, especially multiply-defined ones.

Perhaps we should use AC_CHECK_FUNCS(pthread_mutex_lock ...) and
conditionalize each stub on HAVE_PTHREAD_MUTEX_LOCK etc.

A code generator may be in order. We just want to declare that a certain
list of functions are all aliases for some other function, but every
compiler has a different way of making that declaration. We could do
this with a few AC_SUBSTs and renaming the source file to
thread_stubs.c.in...

But none of that will stop me from committing your changes if people
tell me that it doesn't break XCB for systems that currently work. Your
patch looks basically good.

> If as it is it works, tell me if I need to attach the patch from cg itself.

We'd prefer the output of git-format-patch, which includes the commit
message and authorship information. It looks like the cogito equivalent
is cg-mkpatch.

--Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20061107/7141e5f4/attachment-0001.pgp


More information about the Xcb mailing list