This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH][BZ #15790] Have pthread_mutexattr_gettype mask out the elision bit.
- From: Rich Felker <dalias at aerifal dot cx>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: Cesar Philippidis <cesar at codesourcery dot com>, Andi Kleen <andi at firstfloor dot org>, libc-alpha at sourceware dot org
- Date: Thu, 7 Nov 2013 11:24:25 -0500
- Subject: Re: [PATCH][BZ #15790] Have pthread_mutexattr_gettype mask out the elision bit.
- Authentication-results: sourceware.org; auth=none
- References: <5266B4C3 dot 3090106 at codesourcery dot com> <20131107121529 dot GA17527 at domone>
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.