I am implementing a wrapper around pthread_rwlock_t for iphone dev. Docs say that acquiring a read lock after acquiring a write lock is undefined. Does POSIX allow me to query whether I already have the write lock? Or, what is the best way of preventing this situation from happening?
Thanks!