[Xcb] More pthread stubs.

M Joonas Pihlaja jpihlaja at cc.helsinki.fi
Sat May 8 08:01:50 PDT 2010


On Fri, 7 May 2010, Jamey Sharp wrote:

> For one thing, this can't be compatible with any system's
> PTHREAD_MUTEX_INITIALIZER and related definitions. Right?

In theory this is true, but in practice PTHEAD_MUTEX_INITIALIZER sets 
all zeros in the systems I've looked at.  Of course, there are the 
nonportable initializers which foul this up.

> Does the dependency_group bit actually have the effect you want? I'd
> worry that the linker might still choose the system's stub where
> available even when libpthread-stubs provides one--perhaps dependent
> on link order.

It ought to work because libc is always linked last.

> In short, I guess I've convinced myself that with the possible
> exception of mutexattr_settype, the mutex-related stubs should all
> still use the zero-stub. (And mutexattr_gettype shouldn't be provided,
> yeah?)

Woohoo!  I'm definitely in favour zero stubs, which seem like a much 
more robust solution.

Cheers,

Joonas


More information about the Xcb mailing list