This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Where does MUTEX_INITIALIZER come from on Hurd?


Florian Weimer, on Wed 04 Nov 2015 17:55:42 +0100, wrote:
> We currently have malloc-machine.h and libc-lock.h.  For NPTL targets,
> malloc-machine.h provides MUTEX_INITIALIZER.  But Hurd malloc-machine.h
> does not provide it, and libc-lock.h references it.  Where does it come
> from?

It comes from cthreads.h, outside of glibc:

libthreads/cthreads.h:#define   MUTEX_INITIALIZER       { SPIN_LOCK_INITIALIZER, SPIN_LOCK_INITIALIZER, 0, QUEUE_INITIALIZER, }

> The libc-lock.h wrappers currently do not seem to provide *any*
> replacement for MUTEX_INITIALIZER.  Should we assume that
> zero-initialization works for mutexes?

It will happen to work with the current cthreads implementation, but
that's not guaranteed.

Samuel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]