posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
POSIX_THREADS_EXT
Implementation completeness: 100.0%100IMPLLine coverage: 96.4%96COV

POSIX Threads Extensions option group. More...

Macros

#define PTHREAD_MUTEX_DEFAULT   3
 Default mutex type; behaviour on deadlock/unlock-by-non-owner is undefined.
 
#define PTHREAD_MUTEX_ERRORCHECK   2
 Mutex that returns an error on deadlock or unlock by a non-owner.
 
#define PTHREAD_MUTEX_NORMAL   0
 Non-recursive mutex with no error checks (fastest).
 
#define PTHREAD_MUTEX_RECURSIVE   1
 Recursive mutex; the owning thread may lock it multiple times.
 

Functions

int pthread_attr_getguardsize (const pthread_attr_t *ZRESTRICT attr, size_t *ZRESTRICT guardsize)
 Get the guard size attribute of a thread attributes object.
 
int pthread_attr_setguardsize (pthread_attr_t *attr, size_t guardsize)
 Set the guard size attribute of a thread attributes object.
 
int pthread_mutexattr_gettype (const pthread_mutexattr_t *ZRESTRICT attr, int *ZRESTRICT type)
 Get the type attribute of a mutex attributes object.
 
int pthread_mutexattr_settype (pthread_mutexattr_t *attr, int type)
 Set the type attribute of a mutex attributes object.
 

Detailed Description

POSIX Threads Extensions option group.

Macro Definition Documentation

◆ PTHREAD_MUTEX_DEFAULT

#define PTHREAD_MUTEX_DEFAULT   3

Default mutex type; behaviour on deadlock/unlock-by-non-owner is undefined.

Definition at line 58 of file pthread.h.

◆ PTHREAD_MUTEX_ERRORCHECK

#define PTHREAD_MUTEX_ERRORCHECK   2

Mutex that returns an error on deadlock or unlock by a non-owner.

Definition at line 60 of file pthread.h.

◆ PTHREAD_MUTEX_NORMAL

#define PTHREAD_MUTEX_NORMAL   0

Non-recursive mutex with no error checks (fastest).

Definition at line 62 of file pthread.h.

◆ PTHREAD_MUTEX_RECURSIVE

#define PTHREAD_MUTEX_RECURSIVE   1

Recursive mutex; the owning thread may lock it multiple times.

Definition at line 64 of file pthread.h.

Function Documentation

◆ pthread_attr_getguardsize()

int pthread_attr_getguardsize ( const pthread_attr_t *ZRESTRICT  attr,
size_t *ZRESTRICT  guardsize 
)
pthread_attr_getguardsize line coverage: 100.0%100

Get the guard size attribute of a thread attributes object.

Parameters
attrThread attributes object.
guardsizeOutput: guard size in bytes.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_getguardsize.html

◆ pthread_attr_setguardsize()

int pthread_attr_setguardsize ( pthread_attr_t attr,
size_t  guardsize 
)
pthread_attr_setguardsize line coverage: 83.3%83

Set the guard size attribute of a thread attributes object.

Parameters
attrThread attributes object.
guardsizeGuard size in bytes.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_setguardsize.html

◆ pthread_mutexattr_gettype()

int pthread_mutexattr_gettype ( const pthread_mutexattr_t *ZRESTRICT  attr,
int *ZRESTRICT  type 
)
pthread_mutexattr_gettype line coverage: 100.0%100

Get the type attribute of a mutex attributes object.

Parameters
attrMutex attributes object.
typeOutput: PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_ERRORCHECK, PTHREAD_MUTEX_RECURSIVE, or PTHREAD_MUTEX_DEFAULT.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutexattr_gettype.html

◆ pthread_mutexattr_settype()

int pthread_mutexattr_settype ( pthread_mutexattr_t *  attr,
int  type 
)
pthread_mutexattr_settype line coverage: 100.0%100

Set the type attribute of a mutex attributes object.

Parameters
attrMutex attributes object.
typePTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_ERRORCHECK, PTHREAD_MUTEX_RECURSIVE, or PTHREAD_MUTEX_DEFAULT.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutexattr_settype.html