rw_wrlock

Locks the specified reader-writer lock in the write mode.

Library:LibC
Classification:UNIX International
Service:Synchronization

Syntax

  #include <synch.h>
   
  int   rw_wrlock  (
     rwlock_t   *rwlp );
  

Parameters

rwlp

(IN) Points to the reader-writer lock to acquire in the write mode.

Return Values

Returns 0; no error conditions have been defined.

Remarks

If the lock cannot be acquired immediately, the calling thread waits until the lock can be acquired. No assumptions can be made about the way in which the calling thread might wait for the lock to become free. On return, the calling thread will have acquired the specified lock in the write mode.

UNIX International reader-writer locks are not recursive. Attempting to acquire a recursive write lock causes deadlock.

See Also