This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: pthread.h: Add missing PTHREAD_RWLOCK_INITIALIZER
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: newlib at sourceware dot org
- Date: Mon, 12 Nov 2012 18:51:52 +0100
- Subject: Re: pthread.h: Add missing PTHREAD_RWLOCK_INITIALIZER
- References: <50A12FAE.5040303@oarcorp.com> <50A13560.5040801@rtems.org>
- Reply-to: newlib at sourceware dot org
On Nov 12 18:44, Ralf Corsepius wrote:
> On 11/12/2012 06:19 PM, Joel Sherrill wrote:
> >Hi
> >
> >Attached is a very simple 1 line patch which adds the
> >missing constant PTHREAD_RWLOCK_INITIALIZER and
> >makes it have the same value as the other similar
> >constants.
> >
> >OK to commit?
>
> No.
>
> >2012-11-12 Joel Sherrill <joel.sherrill@oarcorp.com>
> >
> > * libc/include/pthread.h: Add PTHREAD_RWLOCK_INITIALIZER.
> >
>
> Is it your intention to initialize to -1?
>
> If so, initialization to 0xffffffff would not return -1 on platforms
> with size > 32 bit.
>
> Also, your construct would fail on platforms with sizeof(ptr) < 32bit.
sys/types.h defines pthread_rwlock_t as __uint32_t.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat