Why isn't pthread_rwlock_rdlock() deadlocking???
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Thread-index: Acne8qgTfOoVJIH1Ru2tUk4zfhUL5g== Thread-topic: Why isn't pthread_rwlock_rdlock() deadlocking??? I've been busy writing unit tests for an Objective-C wrapper of mine that wraps pthread read/write locks. One of my unit tests should fail with EDEADLK, but I never have that happen. My test code essentially boils down to the following, all of which is run from one thread only: pthread_rwlock_t lock; pthread_rwlock_init(&lock, NULL); pthread_rwlock_rdlock(&lock); pthread_rwlock_rdlock(&lock); // No EDEADLK???? // ignoring the destructor code My understanding of read/write locks is that they are NOT recursive. Am I wrong? Or is this special to Darwin? 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
participants (1)
-
Karan, Cem (Civ, ARL/CISD)