#include <pthread.h> int pthread_rwlock_rdlock(pthread_rwlock_t
*rwlock ); The calling thread acquires the read lock if a writer
does not hold the lock and no writers are blocked on the lock.
Whether the calling thread acquires the lock when a writer does
not hold the lock and writers are waiting for the lock is
unspecified. If a writer holds the lock, the calling thread does
not acquire the read lock. If the read lock is not acquired, the
calling thread blocks. The thread does not return from the
pthread_rwlock_rdlock() until the thread can acquire the lock.
Results are undefined if the calling thread holds a write lock
on rwlock at the time the call is made. Implementations are
allowed to favor writers over readers to avoid writer
starvation. The Solaris implementation favors writers over
readers. A thread can hold multiple concurrent read locks on
rwlock The thread can successfully call pthread_rwlock_rdlock()
n times. The thread must call pthread_rwlock_unlock() n times to
perform matching unlocks. Result