This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] rwlock: Fix explicit hand-over.
- From: Torvald Riegel <triegel at redhat dot com>
- To: Florian Weimer <fw at deneb dot enyo dot de>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>, Waiman Long <longman at redhat dot com>, Carlos O'Donell <codonell at redhat dot com>
- Date: Sat, 25 Mar 2017 21:36:04 +0100
- Subject: Re: [PATCH] rwlock: Fix explicit hand-over.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=triegel at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 31F2A81227
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 31F2A81227
- References: <1490471341.26906.366.camel@redhat.com> <87inmxkt67.fsf@mid.deneb.enyo.de>
On Sat, 2017-03-25 at 21:17 +0100, Florian Weimer wrote:
> * Torvald Riegel:
>
> > + bool registered_while_in_write_phase = false;
> > if (__glibc_likely ((r & PTHREAD_RWLOCK_WRPHASE) == 0))
> > return 0;
> > + else
> > + registered_while_in_write_phase = true;
>
> Sorry, this doesn't look quite right. Isn't
> registered_while_in_write_phase always true?
It's intended and I think it's correct, but I agree it's not pretty :)
I'll fix this by cleaning up the code a little more in v2 of this patch.