Why isn't pthread_rwlock_rdlock() deadlocking???
Why isn't pthread_rwlock_rdlock() deadlocking???
- Subject: Why isn't pthread_rwlock_rdlock() deadlocking???
- From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
- Date: Wed, 27 May 2009 13:43:34 -0400
- 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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden