Read/write locks are recursive
The i5/OS implementation of read/write locks provides a recursive behavior
not only for shared read locks (as the thread standard specifies), but for
exclusive write locks as well. The following statements apply to read/write
locks on i5/OS:
- A thread can acquire any number of shared read locks on a read/write lock.
Each successful shared read lock that is acquired must be released by a call to
pthread_rwlock_unlock().
- A thread can acquire any number of exclusive write locks on a read/write
lock. Each successful exclusive write lock that is acquired must be released by
a call to pthread_rwlock_unlock().