for connected embedded systems
![]() |
![]() |
![]() |
![]() |
pthread_mutexattr_init()
Initialize a mutex attribute object
Synopsis:
#include <pthread.h>
int pthread_mutexattr_init(
const pthread_mutexattr_t* attr );
Arguments:
- attr
- A pointer to the pthread_mutexattr_t object that you want to initialize.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The pthread_mutexattr_init() function initializes the attributes in the mutex attribute object attr to their default values. After initializing a mutex attribute object, you can use it to initialize one or more mutexes by calling pthread_mutex_init().
The mutex attributes and their default values are:
- protocol
- PTHREAD_PRIO_INHERIT
- recursive
- PTHREAD_RECURSIVE_DISABLE
After calling this function, you can use the pthread_mutexattr_* family of functions to make any changes to the attributes:
Returns:
- EOK
- Success.
- ENOMEM
- Insufficient memory to initialize mutex attribute object attr.
Classification:
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |
See also:
pthread_mutex_init(), pthread_mutexattr_destroy(), pthread_mutexattr_getprioceiling(), pthread_mutexattr_getprotocol(), pthread_mutexattr_getpshared(), pthread_mutexattr_getrecursive(), pthread_mutexattr_gettype(), pthread_mutexattr_setprioceiling(), pthread_mutexattr_setprotocol(), pthread_mutexattr_setpshared(), pthread_mutexattr_setrecursive(), pthread_mutexattr_settype()
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)