pthread_mutexattr_settype

Sets the type attribute in the mutex attribute object.

Library:LibC
Classification:POSIX
Service:Synchronization

Syntax

  #include <pthread.h>
   
  int pthread_mutexattr_settype (
     const pthread_mutexattr_t   *attr,
     int                          kind );
  

Parameters

attr

(IN) Points to the mutex attribute object.

kind

(IN) Specifies the value for the type attribute. For a list of supported values, see Section 48.1.1, Mutex Types.

Return Values

If successful, returns 0. Otherwise, returns a nonzero error code.

Decimal

Constant

Description

9

EINVAL

The kind parameter is invalid.

79

ENOTSUP

The kind parameter is set to an unsupported value.

Remarks

The pthread_mutexattr_destroy function destroys an unused mutex attribute object.

See Also