Destroys the specified reader-writer lock.
#include <synch.h> int rwlock_destroy ( rwlock_t *rwlp );
(IN) Points to the reader-writer lock to destroy.
If successful, returns 0; otherwise returns a nonzero error code.
The rwlock_destroy function does not release the memory for the reader-writer lock, but does release the memory allocated by the rwlock_init function. The reader-writer lock being destroyed must have been initialized by calling the rwlock_int function.
To free the memory for the reader-writer lock, call the function that corresponds to the function you used to allocate memory for the lock. For example, if you used malloc the for lock, use free to release the memory.