pthread_rwlock_tryrdlock

Locks the specified reader-writer lock for reading, if it is available.

Library:LibC
Classification:POSIX
Service:Synchronization

Syntax

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

Parameters

rwlp

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

Return Values

If successful, returns zero; otherwise, returns a nonzero error code:

Decimal

Constant

Description

62

EBUSY

The lock is in use and not available.

Remarks

If the lock is immediately available, the pthread_rwlock_tryrdlock function acquires the lock. If the lock is not available, the function returns immediately with an EBUSY error. It does not block.

See Also