Initializes a reader-writer lock.
#include <pthread.h> int pthread_rwlock_init ( pthread_rwlock_t *rwlp, const pthread_rwlockattr_t *attr);
(IN) Points to the reader-writer lock to be initialized.
(IN) Points to an attribute structure for reader-writer locks. If NULL, the reader-writer lock is initialized with default attributes, which mark it as private to the process and provide a generic name of "pthread rwlock".
If successful, returns zero; otherwise, returns a nonzero error code:
Once initialized, the reader-writer lock can be used and reused any number of times without being reinitialized.The function initializes the lock in an unlocked state.
Results are undefined if the lock is used without first being intialized or if the function is called specifying an already initialized reader-writer lock.