|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This header is part ofconcurrency support library and provides support for threads, mutual exclusion, condition variables, and thread-specific storages.
Contents |
thrd_t | implementation-defined complete object type identifying a thread[edit] |
(C11) | creates a thread (function)[edit] |
(C11) | checks if two identifiers refer to the same thread (function)[edit] |
(C11) | obtains the current thread identifier (function)[edit] |
(C11) | suspends execution of the calling thread for the given period of time (function)[edit] |
(C11) | yields the current time slice (function)[edit] |
(C11) | terminates the calling thread (function)[edit] |
(C11) | detaches a thread (function)[edit] |
(C11) | blocks until a thread terminates (function)[edit] |
| indicates a thread error status (constant)[edit] | |
thrd_start_t (C11) | a typedef of the function pointer typeint(*)(void*), used bythrd_create (typedef)[edit] |
mtx_t | mutex identifier[edit] |
(C11) | creates a mutex (function)[edit] |
(C11) | blocks until locks a mutex (function)[edit] |
(C11) | blocks until locks a mutex or times out (function)[edit] |
(C11) | locks a mutex or returns without blocking if already locked (function)[edit] |
(C11) | unlocks a mutex (function)[edit] |
(C11) | destroys a mutex (function)[edit] |
(C11)(C11)(C11) | defines the type of a mutex (enum)[edit] |
Call once | |
(C11) | calls a function exactly once (function)[edit] |
cnd_t | condition variable identifier |
(C11) | creates a condition variable (function)[edit] |
(C11) | unblocks one thread blocked on a condition variable (function)[edit] |
(C11) | unblocks all threads blocked on a condition variable (function)[edit] |
(C11) | blocks on a condition variable (function)[edit] |
(C11) | blocks on a condition variable, with a timeout (function)[edit] |
(C11) | destroys a condition variable (function)[edit] |
(C11)(removed in C23) | convenience macro for storage-class specifier_Thread_local (keyword macro)[edit] |
tss_t | thread-specific storage pointer[edit] |
(C11) | maximum number of times destructors are called (macro constant)[edit] |
tss_dtor_t(C11) | function pointer typevoid(*)(void*), used for TSS destructor (typedef)[edit] |
(C11) | creates thread-specific storage pointer with a given destructor (function)[edit] |
(C11) | reads from thread-specific storage (function)[edit] |
(C11) | write to thread-specific storage (function)[edit] |
(C11) | releases the resources held by a given thread-specific pointer (function)[edit] |
#define __STDC_NO_THREADS__ 202311L #define ONCE_FLAG_INIT /* see description */#define TSS_DTOR_ITERATIONS /* see description */ typedef/* see description */cnd_t;typedef/* see description */thrd_t;typedef/* see description */tss_t;typedef/* see description */mtx_t;typedef/* see description */tss_dtor_t;typedef/* see description */thrd_start_t; #define mtx_plain /* see description */#define mtx_recursive /* see description */#define mtx_timed /* see description */#define once_flag /* see description */#define thrd_busy /* see description */#define thrd_error /* see description */#define thrd_nomem /* see description */#define thrd_success /* see description */#define thrd_timedout /* see description */ voidcall_once(once_flag* flag,void(*func)(void));intcnd_broadcast(cnd_t* cond);voidcnd_destroy(cnd_t* cond);intcnd_init(cnd_t* cond);intcnd_signal(cnd_t* cond);intcnd_timedwait(cnd_t*restrict cond,mtx_t*restrict mtx,conststruct timespec*restrict ts);intcnd_wait(cnd_t* cond,mtx_t* mtx);voidmtx_destroy(mtx_t* mtx);intmtx_init(mtx_t* mtx,int type);intmtx_lock(mtx_t* mtx);intmtx_timedlock(mtx_t*restrict mtx,conststruct timespec*restrict ts);intmtx_trylock(mtx_t* mtx);intmtx_unlock(mtx_t* mtx);intthrd_create(thrd_t* thr,thrd_start_t func,void* arg);thrd_tthrd_current(void);intthrd_detach(thrd_t thr);intthrd_equal(thrd_t thr0,thrd_t thr1);[[noreturn]]voidthrd_exit(int res);intthrd_join(thrd_t thr,int* res);intthrd_sleep(conststruct timespec* duration,struct timespec* remaining);voidthrd_yield(void);inttss_create(tss_t* key,tss_dtor_t dtor);voidtss_delete(tss_t key);void*tss_get(tss_t key);inttss_set(tss_t key,void* val);