mutex_init

Initializes a mutex.

Library:LibC
Classification:UNIX International
Service:Synchronization

Syntax

  #include <synch.h>
   
  int   mutex_init (
     mutex_t   *mp,
     int        type,
     void      *arg );
  

Parameters

mp

(IN) Points to the mutex to be initialized.

type

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

Flag

Value

Description

USYNC_THREAD

0

The mutex is known only to the owning process.

USYNC_PROCESS

1

Unsupported. The mutex 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

UI mutexes cannot be recursive.

See Also