Some pthreads documentation mentions that pthread_rwlock_wrlock/pthread_rwlock_trywrlock can upgrade an existing shared read lock to a write lock, under some conditions.
The POSIX:2008 / IEEE Std 1003.1-2008 says in the opposite way:"The calling thread may deadlock if at the time the call is made it holds the read-write lock (whether a read or write lock)."
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_wrlock.html Petr