site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Thread-index: Acnfx0N0CaCUl+dXSmW6wux4MR6ZQgACoA1g 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 (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com