rwlock_destroy

Destroys the specified reader-writer lock.

Library:LibC
Classification:UNIX International
Service:Synchronization

Syntax

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

Parameters

rwlp

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

Return Values

If successful, returns 0; otherwise returns a nonzero error code.

Decimal

Constant

Description

9

EINVAL

The mutex is not a valid mutex.

62

EBUSY

The lock is in use.

Remarks

The rwlock_destroy function does not release the memory for the reader-writer lock, but does release the memory allocated by the rwlock_init function. The reader-writer lock being destroyed must have been initialized by calling the rwlock_int function.

To free the memory for the reader-writer lock, call the function that corresponds to the function you used to allocate memory for the lock. For example, if you used malloc the for lock, use free to release the memory.

See Also