Re: static initialization of pthread_rwlock_t?
Re: static initialization of pthread_rwlock_t?
- Subject: Re: static initialization of pthread_rwlock_t?
- From: Terry Lambert <email@hidden>
- Date: Tue, 9 Jun 2009 19:08:01 -0700
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.
-- Terry
_______________________________________________
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