-DXTHREADS and standalone libraries

Owen Taylor otaylor at redhat.com
Tue Nov 2 16:31:12 PST 2004

It looks like to me that XTHREADS is getting defined only when building
the X server itself, and not when building any of the extension

Without XTHREADS being defined, macros like LockDisplay(), and so
forth are no-ops, so the resulting libraries aren't thread safe.

It would be possible to add separate --disable-xthreads and
XTHREAD_CFLAGS to all the individual libraries, but it seems to me
that it might be better to add -DXTHREADS to the Xflags: line
in X11.pc, so that everything (and all apps) automatically pick
it up.

Another option would be to remove uses of XTHREADS in the Xlib public
headers, and simply stub out the virtual functions that get called
if Xlib wasn't built with threading support. This would cause a little
bit of code bloat and performance in the various extension libraries,
but would remove something that could go wrong.

What do people think?

[ Filed as http://www.freedesktop.org/bugzilla/show_bug.cgi?id=1766 ]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20041102/ff5070ba/attachment.pgp>

More information about the xorg mailing list