rwlock_init

Initializes a reader-writer lock.

Library:LibC
Classification:UNIX International
Service:Synchronization

Syntax

  #include <synch.h>
   
  int   rwlock_init  (
     rwlock_t   *rwlp,
     int         type,
     void       *arg );
  

Parameters

rwlp

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

type

(IN) Specifies the type of mutex with one of the following flags:

Flag

Value

Description

USYNC_THREAD

0

The lock is known only to the owning process.

USYNC_PROCESS

1

Unsupported. The lock can be shared between processes.

arg

(IN) Reserved for future use. Set to NULL

Return Values

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

Decimal

Constant

Description

79

ENOTSUP

The type parameter contains an invalid value.

Remarks

Mutually exclusive locks are acquired by threads on behalf of the context that they might be hosting.

See Also