pthread_rwlock_trywrlock

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

Library:LibC
Classification:POSIX
Service:Synchronization

Syntax

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

Parameters

rwlp

(IN) Points to the reader lock.

Return Values

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

Decimal

Constant

Description

62

EBUSY

The lock is in use and is not available.

Remarks

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

See Also