This is the mail archive of the 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: [PATCH][BZ #15790] Have pthread_mutexattr_gettype mask out the elision bit.

On Thu, Nov 07, 2013 at 01:15:29PM +0100, OndÅej BÃlka wrote:
> On Tue, Oct 22, 2013 at 10:24:19AM -0700, Cesar Philippidis wrote:
> > This patch addresses the issue in BZ #15790. I'm not sure why
> > pthread_mutexattr_gettype is returning PTHREAD_MUTEX_NO_ELISION_NP,
> > since that seems to be an internal flag. Tolga Dalman's comment on BZ
> > suggests that PTHREAD_MUTEX_NO_ELISION_NP should be added to
> > PTHREAD_MUTEXATTR_FLAG_BITS. However, doing that may cause problems with
> > __pthread_mutex_init().
> > 
> > Is this patch OK?
> > 
> Andi, it is unclear that if this is desired behaviour, one argument
> againist could be that if user wants to clone mutex type like
> int tp;
> pthread_mutexattr_gettype(a1, &tp);
> pthread_mutexattr_settype(a2, tp);
> should it preserve elision or not?

Of course not. To clone an attribute object you have to clone all of
its properties. Cloning one does not (and should not) implicitly clone
others. (Note that the lack of a way to fully clone an attribute
object including implementation-defined additional properties is
lacking from POSIX...)

Anyway this was all discussed in the original elision threads;
apparently the current behavior is just a bug that slipped through.
But it's a conformance issue that needs to be fixed.


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