pthread_rwlock_wrlock

Locks the specified reader-writer lock for writing.

Library:LibC
Classification:POSIX
Service:Synchronization

Syntax

  #include <pthread.h>
   
  int  pthread_rwlock_wrlock  (
     pthread_rwlock_t   *rwlp);
  

Parameters

rwlp

(IN) Points to the reader-writer lock to lock.

Return Values

When successful in obtaining the write lock, returns zero.

Remarks

If no one else has the lock locked for reading or writing, the pthread_rwlock_wrlock function acquires a writing lock for the specified lock. If the lock is not available, the function blocks until a writing lock can be acquired.

See Also