posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
POSIX_THREADS_BASE
Implementation completeness: 100.0%100IMPLLine coverage: 94.6%95COVLinux compatibility tests: passing🐧Userspace tests: passingU

POSIX Threads Base option group. More...

Macros

#define PTHREAD_CANCEL_ASYNCHRONOUS   1
 Thread cancellation is performed immediately.
 
#define PTHREAD_CANCEL_ENABLE   0
 Cancellation is enabled (default).
 
#define PTHREAD_CANCEL_DEFERRED   0
 Cancellation is deferred until a cancellation point (default).
 
#define PTHREAD_CANCEL_DISABLE   1
 Cancellation delivery is disabled.
 
#define PTHREAD_CANCELED   ((void *)-1)
 Value returned by pthread_join() for a cancelled thread.
 
#define PTHREAD_CREATE_DETACHED   1
 Thread is created in the detached state.
 
#define PTHREAD_CREATE_JOINABLE   0
 Thread is created in the joinable state (default).
 
#define PTHREAD_ONCE_INIT   _PTHREAD_ONCE_INITIALIZER
 Static initialiser for pthread_once_t objects.
 
#define PTHREAD_PRIO_NONE   0
 Mutex protocol: no priority inheritance or ceiling.
 
#define PTHREAD_COND_INITIALIZER   _PTHREAD_COND_INITIALIZER
 Static initialiser for pthread_cond_t objects.
 
#define PTHREAD_MUTEX_INITIALIZER   _PTHREAD_MUTEX_INITIALIZER
 Static initialiser for pthread_mutex_t objects.
 
#define pthread_cleanup_push(_rtn, _arg)
 Push a cleanup handler onto the calling thread's cleanup stack.
 
#define pthread_cleanup_pop(_ex)
 Pop a cleanup handler from the calling thread's cleanup stack.
 

Functions

int pthread_kill (pthread_t thread, int sig)
 Send a signal to a specific thread.
 
int pthread_sigmask (int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset)
 Examine and change blocked signals for the calling thread.
 
int pthread_attr_destroy (pthread_attr_t *attr)
 Destroy a thread attributes object.
 
int pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate)
 Get the detach state attribute of a thread attributes object.
 
int pthread_attr_getschedparam (const pthread_attr_t *ZRESTRICT attr, struct sched_param *ZRESTRICT param)
 Get the scheduling parameter attribute of a thread attributes object.
 
int pthread_attr_init (pthread_attr_t *attr)
 Initialise a thread attributes object with default values.
 
int pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate)
 Set the detach state attribute of a thread attributes object.
 
int pthread_attr_setschedparam (pthread_attr_t *ZRESTRICT attr, const struct sched_param *ZRESTRICT param)
 Set the scheduling parameter attribute of a thread attributes object.
 
int pthread_cancel (pthread_t thread)
 Send a cancellation request to a thread.
 
int pthread_cond_broadcast (pthread_cond_t *cond)
 Broadcast a condition variable, waking all waiting threads.
 
int pthread_cond_destroy (pthread_cond_t *cond)
 Destroy a condition variable.
 
int pthread_cond_init (pthread_cond_t *ZRESTRICT cond, const pthread_condattr_t *ZRESTRICT attr)
 Initialise a condition variable.
 
int pthread_cond_signal (pthread_cond_t *cond)
 Signal a condition variable, waking at least one waiting thread.
 
int pthread_cond_timedwait (pthread_cond_t *ZRESTRICT cond, pthread_mutex_t *ZRESTRICT mutex, const struct timespec *ZRESTRICT abstime)
 Wait on a condition variable with an absolute timeout (CLOCK_REALTIME).
 
int pthread_cond_wait (pthread_cond_t *ZRESTRICT cond, pthread_mutex_t *ZRESTRICT mutex)
 Wait on a condition variable.
 
int pthread_condattr_destroy (pthread_condattr_t *attr)
 Destroy a condition variable attributes object.
 
int pthread_condattr_init (pthread_condattr_t *attr)
 Initialise a condition variable attributes object with default values.
 
int pthread_create (pthread_t *ZRESTRICT thread, const pthread_attr_t *ZRESTRICT attr, void *(*start_routine)(void *), void *ZRESTRICT arg)
 Create a new thread.
 
int pthread_detach (pthread_t thread)
 Detach a thread, releasing its resources automatically on termination.
 
int pthread_equal (pthread_t t1, pthread_t t2)
 Compare two thread IDs.
 
void pthread_exit (void *value_ptr)
 Terminate the calling thread.
 
void * pthread_getspecific (pthread_key_t key)
 Get the thread-specific value associated with a key.
 
int pthread_join (pthread_t thread, void **value_ptr)
 Wait for a thread to terminate and retrieve its exit status.
 
int pthread_key_create (pthread_key_t *key, void(*destructor)(void *))
 Create a thread-specific data key.
 
int pthread_key_delete (pthread_key_t key)
 Delete a thread-specific data key.
 
int pthread_mutex_destroy (pthread_mutex_t *mutex)
 Destroy a mutex.
 
int pthread_mutex_init (pthread_mutex_t *ZRESTRICT mutex, const pthread_mutexattr_t *ZRESTRICT attr)
 Initialise a mutex.
 
int pthread_mutex_lock (pthread_mutex_t *mutex)
 Lock a mutex, blocking until it is available.
 
int pthread_mutex_timedlock (pthread_mutex_t *ZRESTRICT mutex, const struct timespec *ZRESTRICT abstime)
 Lock a mutex with an absolute timeout.
 
int pthread_mutex_trylock (pthread_mutex_t *mutex)
 Try to lock a mutex without blocking.
 
int pthread_mutex_unlock (pthread_mutex_t *mutex)
 Unlock a mutex.
 
int pthread_mutexattr_destroy (pthread_mutexattr_t *attr)
 Destroy a mutex attributes object.
 
int pthread_mutexattr_init (pthread_mutexattr_t *attr)
 Initialise a mutex attributes object with default values.
 
int pthread_once (pthread_once_t *once_control, void(*init_routine)(void))
 Ensure a one-time initialisation routine is called exactly once.
 
pthread_t pthread_self (void)
 Return the thread ID of the calling thread.
 
int pthread_setcancelstate (int state, int *oldstate)
 Set the cancellability state of the calling thread.
 
int pthread_setcanceltype (int type, int *oldtype)
 Set the cancellability type of the calling thread.
 
int pthread_setspecific (pthread_key_t key, const void *value)
 Set the thread-specific value associated with a key.
 
void pthread_testcancel (void)
 Create a cancellation point in the calling thread.
 
int sched_yield (void)
 Yield the processor to another thread of equal or higher priority.
 

Detailed Description

POSIX Threads Base option group.

Macro Definition Documentation

◆ PTHREAD_CANCEL_ASYNCHRONOUS

#define PTHREAD_CANCEL_ASYNCHRONOUS   1

Thread cancellation is performed immediately.

Definition at line 38 of file pthread.h.

◆ PTHREAD_CANCEL_DEFERRED

#define PTHREAD_CANCEL_DEFERRED   0

Cancellation is deferred until a cancellation point (default).

Definition at line 42 of file pthread.h.

◆ PTHREAD_CANCEL_DISABLE

#define PTHREAD_CANCEL_DISABLE   1

Cancellation delivery is disabled.

Definition at line 44 of file pthread.h.

◆ PTHREAD_CANCEL_ENABLE

#define PTHREAD_CANCEL_ENABLE   0

Cancellation is enabled (default).

Definition at line 40 of file pthread.h.

◆ PTHREAD_CANCELED

#define PTHREAD_CANCELED   ((void *)-1)

Value returned by pthread_join() for a cancelled thread.

Definition at line 46 of file pthread.h.

◆ pthread_cleanup_pop

#define pthread_cleanup_pop (   _ex)
Value:
k_thread_cleanup_pop(_ex); \
} /* enforce '}'-like behaviour */ \
while (0)

Pop a cleanup handler from the calling thread's cleanup stack.

Parameters
_exIf non-zero, the handler is executed before being removed.
Note
This macro must be paired with pthread_cleanup_push() in the same lexical scope.

Definition at line 1209 of file pthread.h.

◆ pthread_cleanup_push

#define pthread_cleanup_push (   _rtn,
  _arg 
)
Value:
do /* enforce '{'-like behaviour */ { \
void *_z_pthread_cleanup[3]; \
k_thread_cleanup_push(_z_pthread_cleanup, _rtn, _arg)

Push a cleanup handler onto the calling thread's cleanup stack.

The handler _rtn is called with _arg when the thread exits or calls pthread_cleanup_pop() with a non-zero argument.

Note
This macro must be paired with pthread_cleanup_pop() in the same lexical scope.

Definition at line 1195 of file pthread.h.

◆ PTHREAD_COND_INITIALIZER

#define PTHREAD_COND_INITIALIZER   _PTHREAD_COND_INITIALIZER

Static initialiser for pthread_cond_t objects.

Definition at line 96 of file pthread.h.

◆ PTHREAD_CREATE_DETACHED

#define PTHREAD_CREATE_DETACHED   1

Thread is created in the detached state.

Definition at line 48 of file pthread.h.

◆ PTHREAD_CREATE_JOINABLE

#define PTHREAD_CREATE_JOINABLE   0

Thread is created in the joinable state (default).

Definition at line 50 of file pthread.h.

◆ PTHREAD_MUTEX_INITIALIZER

#define PTHREAD_MUTEX_INITIALIZER   _PTHREAD_MUTEX_INITIALIZER

Static initialiser for pthread_mutex_t objects.

Definition at line 98 of file pthread.h.

◆ PTHREAD_ONCE_INIT

#define PTHREAD_ONCE_INIT   _PTHREAD_ONCE_INITIALIZER

Static initialiser for pthread_once_t objects.

Definition at line 70 of file pthread.h.

◆ PTHREAD_PRIO_NONE

#define PTHREAD_PRIO_NONE   0

Mutex protocol: no priority inheritance or ceiling.

Definition at line 78 of file pthread.h.

Function Documentation

◆ pthread_attr_destroy()

int pthread_attr_destroy ( pthread_attr_t attr)
pthread_attr_destroy line coverage: 85.7%86Linux compatibility tests: passing🐧Userspace tests: passingU

Destroy a thread attributes object.

Parameters
attrThread attributes object to destroy.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_destroy.html

◆ pthread_attr_getdetachstate()

int pthread_attr_getdetachstate ( const pthread_attr_t attr,
int *  detachstate 
)
pthread_attr_getdetachstate line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Get the detach state attribute of a thread attributes object.

Parameters
attrThread attributes object.
detachstateOutput: PTHREAD_CREATE_DETACHED or PTHREAD_CREATE_JOINABLE.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_getdetachstate.html

◆ pthread_attr_getschedparam()

int pthread_attr_getschedparam ( const pthread_attr_t *ZRESTRICT  attr,
struct sched_param *ZRESTRICT  param 
)
pthread_attr_getschedparam line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Get the scheduling parameter attribute of a thread attributes object.

Parameters
attrThread attributes object.
paramOutput: scheduling parameters.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_getschedparam.html

◆ pthread_attr_init()

int pthread_attr_init ( pthread_attr_t attr)
pthread_attr_init line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Initialise a thread attributes object with default values.

Parameters
attrThread attributes object to initialise.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_init.html

◆ pthread_attr_setdetachstate()

int pthread_attr_setdetachstate ( pthread_attr_t attr,
int  detachstate 
)
pthread_attr_setdetachstate line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Set the detach state attribute of a thread attributes object.

Parameters
attrThread attributes object.
detachstatePTHREAD_CREATE_DETACHED or PTHREAD_CREATE_JOINABLE.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_setdetachstate.html

◆ pthread_attr_setschedparam()

int pthread_attr_setschedparam ( pthread_attr_t *ZRESTRICT  attr,
const struct sched_param *ZRESTRICT  param 
)
pthread_attr_setschedparam line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Set the scheduling parameter attribute of a thread attributes object.

Parameters
attrThread attributes object.
paramScheduling parameters to apply.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_setschedparam.html

◆ pthread_cancel()

int pthread_cancel ( pthread_t  thread)
pthread_cancel line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Send a cancellation request to a thread.

Parameters
threadThread to cancel.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cancel.html

◆ pthread_cond_broadcast()

int pthread_cond_broadcast ( pthread_cond_t *  cond)
pthread_cond_broadcast line coverage: 83.3%83Linux compatibility tests: passing🐧Userspace tests: passingU

Broadcast a condition variable, waking all waiting threads.

Parameters
condCondition variable to broadcast.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_broadcast.html

◆ pthread_cond_destroy()

int pthread_cond_destroy ( pthread_cond_t *  cond)
pthread_cond_destroy line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Destroy a condition variable.

Parameters
condCondition variable to destroy.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_destroy.html

◆ pthread_cond_init()

int pthread_cond_init ( pthread_cond_t *ZRESTRICT  cond,
const pthread_condattr_t *ZRESTRICT  attr 
)
pthread_cond_init line coverage: 85.0%85Linux compatibility tests: passing🐧Userspace tests: passingU

Initialise a condition variable.

Parameters
condCondition variable to initialise.
attrCondition variable attributes, or NULL for defaults.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_init.html

◆ pthread_cond_signal()

int pthread_cond_signal ( pthread_cond_t *  cond)
pthread_cond_signal line coverage: 83.3%83Linux compatibility tests: passing🐧Userspace tests: passingU

Signal a condition variable, waking at least one waiting thread.

Parameters
condCondition variable to signal.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_signal.html

◆ pthread_cond_timedwait()

int pthread_cond_timedwait ( pthread_cond_t *ZRESTRICT  cond,
pthread_mutex_t *ZRESTRICT  mutex,
const struct timespec *ZRESTRICT  abstime 
)
pthread_cond_timedwait line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Wait on a condition variable with an absolute timeout (CLOCK_REALTIME).

Parameters
condCondition variable.
mutexAssociated mutex (must be locked by the caller).
abstimeAbsolute timeout (CLOCK_REALTIME).
Returns
0 on success, ETIMEDOUT on timeout, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_timedwait.html

◆ pthread_cond_wait()

int pthread_cond_wait ( pthread_cond_t *ZRESTRICT  cond,
pthread_mutex_t *ZRESTRICT  mutex 
)
pthread_cond_wait line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Wait on a condition variable.

Parameters
condCondition variable.
mutexAssociated mutex (must be locked by the caller).
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_wait.html

◆ pthread_condattr_destroy()

int pthread_condattr_destroy ( pthread_condattr_t *  attr)
pthread_condattr_destroy line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Destroy a condition variable attributes object.

Parameters
attrCondition variable attributes object to destroy.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_condattr_destroy.html

◆ pthread_condattr_init()

int pthread_condattr_init ( pthread_condattr_t *  attr)
pthread_condattr_init line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Initialise a condition variable attributes object with default values.

Parameters
attrCondition variable attributes object to initialise.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_condattr_init.html

◆ pthread_create()

int pthread_create ( pthread_t *ZRESTRICT  thread,
const pthread_attr_t *ZRESTRICT  attr,
void *(*)(void *)  start_routine,
void *ZRESTRICT  arg 
)
pthread_create line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Create a new thread.

Parameters
threadOutput: thread ID of the new thread.
attrThread attributes, or NULL for defaults.
start_routineThread entry point function.
argArgument passed to start_routine.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_create.html

◆ pthread_detach()

int pthread_detach ( pthread_t  thread)
pthread_detach line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Detach a thread, releasing its resources automatically on termination.

Parameters
threadThread to detach.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_detach.html

◆ pthread_equal()

int pthread_equal ( pthread_t  t1,
pthread_t  t2 
)
pthread_equal line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Compare two thread IDs.

Parameters
t1First thread ID.
t2Second thread ID.
Returns
Non-zero if t1 and t2 refer to the same thread, 0 otherwise.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_equal.html

◆ pthread_exit()

void pthread_exit ( void *  value_ptr)
pthread_exit line coverage: 66.7%67Linux compatibility tests: passing🐧Userspace tests: passingU

Terminate the calling thread.

Parameters
value_ptrValue made available to pthread_join().
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_exit.html

◆ pthread_getspecific()

void * pthread_getspecific ( pthread_key_t  key)
pthread_getspecific line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Get the thread-specific value associated with a key.

Parameters
keyThread-specific data key.
Returns
Value associated with key for the calling thread, or NULL if none.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_getspecific.html

◆ pthread_join()

int pthread_join ( pthread_t  thread,
void **  value_ptr 
)
pthread_join line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Wait for a thread to terminate and retrieve its exit status.

Parameters
threadThread to wait for.
value_ptrOutput: exit value or PTHREAD_CANCELED.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_join.html

◆ pthread_key_create()

int pthread_key_create ( pthread_key_t *  key,
void(*)(void *)  destructor 
)
pthread_key_create line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Create a thread-specific data key.

Parameters
keyOutput: new key.
destructorDestructor called with the thread's value when the thread exits, or NULL.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_key_create.html

◆ pthread_key_delete()

int pthread_key_delete ( pthread_key_t  key)
pthread_key_delete line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Delete a thread-specific data key.

Parameters
keyKey to delete.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_key_delete.html

◆ pthread_kill()

int pthread_kill ( pthread_t  thread,
int  sig 
)
pthread_kill line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Send a signal to a specific thread.

Parameters
threadTarget thread.
sigSignal number, or 0 to check thread existence.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_kill.html

◆ pthread_mutex_destroy()

int pthread_mutex_destroy ( pthread_mutex_t *  mutex)
pthread_mutex_destroy line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Destroy a mutex.

Parameters
mutexMutex to destroy.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_destroy.html

◆ pthread_mutex_init()

int pthread_mutex_init ( pthread_mutex_t *ZRESTRICT  mutex,
const pthread_mutexattr_t *ZRESTRICT  attr 
)
pthread_mutex_init line coverage: 88.9%89Linux compatibility tests: passing🐧Userspace tests: passingU

Initialise a mutex.

Parameters
mutexMutex to initialise.
attrMutex attributes, or NULL for defaults.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_init.html

◆ pthread_mutex_lock()

int pthread_mutex_lock ( pthread_mutex_t *  mutex)
pthread_mutex_lock line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Lock a mutex, blocking until it is available.

Parameters
mutexMutex to lock.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html

◆ pthread_mutex_timedlock()

int pthread_mutex_timedlock ( pthread_mutex_t *ZRESTRICT  mutex,
const struct timespec *ZRESTRICT  abstime 
)
pthread_mutex_timedlock line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Lock a mutex with an absolute timeout.

Parameters
mutexMutex to lock.
abstimeAbsolute timeout (CLOCK_REALTIME).
Returns
0 on success, ETIMEDOUT on timeout, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_timedlock.html

◆ pthread_mutex_trylock()

int pthread_mutex_trylock ( pthread_mutex_t *  mutex)
pthread_mutex_trylock line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Try to lock a mutex without blocking.

Parameters
mutexMutex to try to lock.
Returns
0 if the lock was acquired, EBUSY if already locked, or a positive error number.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_trylock.html

◆ pthread_mutex_unlock()

int pthread_mutex_unlock ( pthread_mutex_t *  mutex)
pthread_mutex_unlock line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Unlock a mutex.

Parameters
mutexMutex to unlock.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_unlock.html

◆ pthread_mutexattr_destroy()

int pthread_mutexattr_destroy ( pthread_mutexattr_t *  attr)
pthread_mutexattr_destroy line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Destroy a mutex attributes object.

Parameters
attrMutex attributes object to destroy.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutexattr_destroy.html

◆ pthread_mutexattr_init()

int pthread_mutexattr_init ( pthread_mutexattr_t *  attr)
pthread_mutexattr_init line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Initialise a mutex attributes object with default values.

Parameters
attrMutex attributes object to initialise.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutexattr_init.html

◆ pthread_once()

int pthread_once ( pthread_once_t *  once_control,
void(*)(void)  init_routine 
)
pthread_once line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Ensure a one-time initialisation routine is called exactly once.

Parameters
once_controlPointer to a pthread_once_t initialised with PTHREAD_ONCE_INIT.
init_routineInitialisation function to call at most once.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_once.html

◆ pthread_self()

pthread_t pthread_self ( void  )
pthread_self line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Return the thread ID of the calling thread.

Returns
Thread ID of the calling thread.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_self.html

◆ pthread_setcancelstate()

int pthread_setcancelstate ( int  state,
int *  oldstate 
)
pthread_setcancelstate line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Set the cancellability state of the calling thread.

Parameters
statePTHREAD_CANCEL_ENABLE or PTHREAD_CANCEL_DISABLE.
oldstateOutput: previous state, or NULL.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_setcancelstate.html

◆ pthread_setcanceltype()

int pthread_setcanceltype ( int  type,
int *  oldtype 
)
pthread_setcanceltype line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Set the cancellability type of the calling thread.

Parameters
typePTHREAD_CANCEL_DEFERRED or PTHREAD_CANCEL_ASYNCHRONOUS.
oldtypeOutput: previous type, or NULL.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_setcanceltype.html

◆ pthread_setspecific()

int pthread_setspecific ( pthread_key_t  key,
const void *  value 
)
pthread_setspecific line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Set the thread-specific value associated with a key.

Parameters
keyThread-specific data key.
valueValue to associate with key for the calling thread.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_setspecific.html

◆ pthread_sigmask()

int pthread_sigmask ( int  how,
const sigset_t *ZRESTRICT  set,
sigset_t *ZRESTRICT  oset 
)
pthread_sigmask line coverage: 95.5%95Linux compatibility tests: passing🐧Userspace tests: passingU

Examine and change blocked signals for the calling thread.

Parameters
howSIG_BLOCK, SIG_UNBLOCK, or SIG_SETMASK.
setSignal set to apply, or NULL.
osetOutput: previous signal mask, or NULL.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html

◆ pthread_testcancel()

void pthread_testcancel ( void  )
pthread_testcancel line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Create a cancellation point in the calling thread.

If cancellation is pending and enabled, this function does not return.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_testcancel.html

◆ sched_yield()

int sched_yield ( void  )
sched_yield line coverage: 100.0%100Linux compatibility tests: passing🐧Userspace tests: passingU

Yield the processor to another thread of equal or higher priority.

Returns
0 on success, or -1 with errno set on failure.
See also
IEEE 1003.1, sched_yield
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_yield.html