pthread_rwlock_rdlock

Locks the specified reader-writer lock for reading.

Library:LibC
Classification:POSIX
Service:Synchronization

Syntax

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

Parameters

rwlp

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

Return Values

When successful in obtaining the lock, returns zero.

Remarks

The pthread_rwlock_rdlock function acquires a read lock only if a writer does not hold the lock and no writers are blocked on the lock. The function blocks until the lock is available.

See Also