NXWrLock

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

Library:LibC
Classification:NKS
Service:Synchronization

Syntax

  #include <nks/synch.h>
   
  void NXWrLock (
     NXRwLock_t  *lock);
  

Parameters

lock

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

Remarks

The hierarchy value of the reader-writer lock being acquired should be greater than any of the reader-writer locks that might be currently held by this context. For a discussion on lock hierarchy, see NXRwLockAlloc or NXRwLockInit.

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.

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

See Also