RE: static initialization of pthread_rwlock_t?
RE: static initialization of pthread_rwlock_t?
- Subject: RE: static initialization of pthread_rwlock_t?
- From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
- Date: Wed, 10 Jun 2009 09:23:54 -0400
- Thread-topic: static initialization of pthread_rwlock_t?
Terry Lambert wrote on Tuesday, June 09, 2009 10:08 PM
> On Jun 8, 2009, at 12:26 PM, Karan, Cem (Civ, ARL/CISD) wrote:
> > Greg Parker wrote on Monday, June 08, 2009 1:02 PM
> >> On Jun 8, 2009, at 6:31 AM, Karan, Cem (Civ, ARL/CISD) wrote:
> >>> I know I can statically initialize a pthread_mutex_t via
> >>> PTHREAD_MUTEX_INITIALIZER; is there a similar macro/method for
> >>> pthread_rwlock_t instances? Note that I need a POSIX compliant
> >>> method, so special Darwin-only methods are out.
> >>
> >> PTHREAD_RWLOCK_INITIALIZER
> >>
> >> Introduced in Leopard, I think. I don't know if it's
> formally POSIX,
> >> but it seems common enough elsewhere.
> >
> > Cool, thanks. I'll double check the Windows-side library to see if
> > its in there, if it is, then this works for me!
>
> PTHREAD_RWLOCK_INITIALIZER was deleted from the Single Unix
> Specification in 2000 in issue 6 for alignment with IEEE
> 1003.1j-2000 (the final pthreads standard). You should not
> use it in new code which you expect to be portable. A
> constructor-based approach, as has been suggested by others,
> is a better way to go.
I see. OK, thank you, I'll go with the constructor approach then.
Thanks,
Cem Karan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden