Re: Why isn't pthread_rwlock_rdlock() deadlocking???
Re: Why isn't pthread_rwlock_rdlock() deadlocking???
- Subject: Re: Why isn't pthread_rwlock_rdlock() deadlocking???
- From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
- Date: Thu, 28 May 2009 16:29:22 -0400
- Thread-topic: Why isn't pthread_rwlock_rdlock() deadlocking???
On Thu, 28 May 2009 11:59:57 -0700 Jason Coco wrote:
<<SNIP>>
>
> That's definitely clearer, but the man page does say that the
> results of obtaining a
> read or write lock when the current thread already holds the
> opposite type of lock
> are undefined. Since returning EDEADLOCK is optional, Apple probably
> wants to choose what to do in the future, so the best choice is to
> ensure that your code never
> does this through review or some other mechanism (as annoying
> as that is).
Agreed, but I find that paranoid self-checking code is useful when
someone else borrows your code and breaks your assumptions. It's
happened to me before, which is why I prefer some way of building in
debugging checks whenever possible.
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