Difference between revisions of "c/thread"
From cppreference.com
< c
m (Text replace - "/sidebar" to "/navbar") |
(fmt) |
||
Line 7: | Line 7: | ||
{{dcl list begin}} | {{dcl list begin}} | ||
{{dcl list header | threads.h}} | {{dcl list header | threads.h}} | ||
− | {{dcl list item | cnd_t | condition variable identifier | notes={{mark c11}}}} | + | {{dcl list item | {{tt|cnd_t}} | condition variable identifier | notes={{mark c11}}}} |
− | {{dcl list item | thrd_t | thread identifier | notes={{mark c11}}}} | + | {{dcl list item | {{tt|thrd_t}} | thread identifier | notes={{mark c11}}}} |
− | {{dcl list item | tss_t | thread-specific storage pointer | notes={{mark c11}}}} | + | {{dcl list item | {{tt|tss_t}} | thread-specific storage pointer | notes={{mark c11}}}} |
− | {{dcl list item | mtx_t | mutex identifier | notes={{mark c11}}}} | + | {{dcl list item | {{tt|mtx_t}} | mutex identifier | notes={{mark c11}}}} |
− | {{dcl list item | tss_dtor_t | function pointer type used for TSS destructor | notes={{mark c11}}}} | + | {{dcl list item | {{tt|tss_dtor_t}} | function pointer type used for TSS destructor | notes={{mark c11}}}} |
− | {{dcl list item | thrd_start_t | function pointer type passed to thrd_create | notes={{mark c11}}}} | + | {{dcl list item | {{tt|thrd_start_t}} | function pointer type passed to thrd_create | notes={{mark c11}}}} |
− | {{dcl list item | once_flag | the type of the flag used by call_once | notes={{mark c11}}}} | + | {{dcl list item | {{tt|once_flag}} | the type of the flag used by call_once | notes={{mark c11}}}} |
{{dcl list end}} | {{dcl list end}} | ||
===Constants=== | ===Constants=== | ||
{{dcl list begin}} | {{dcl list begin}} | ||
− | {{dcl list item | mtx_plain | indicates plain mutex for mtx_init | notes={{mark c11}}}} | + | {{dcl list item | {{tt|mtx_plain}} | indicates plain mutex for mtx_init | notes={{mark c11}}}} |
− | {{dcl list item | mtx_recursive | indicates recursive mutex for mtx_init | notes={{mark c11}}}} | + | {{dcl list item | {{tt|mtx_recursive}} | indicates recursive mutex for mtx_init | notes={{mark c11}}}} |
− | {{dcl list item | mtx_timed | indicates timed mutex for mtx_init | notes={{mark c11}}}} | + | {{dcl list item | {{tt|mtx_timed}} | indicates timed mutex for mtx_init | notes={{mark c11}}}} |
− | {{dcl list item | thrd_timedout | indicates timed out return value | notes={{mark c11}}}} | + | {{dcl list item | {{tt|thrd_timedout}} | indicates timed out return value | notes={{mark c11}}}} |
− | {{dcl list item | thrd_success | indicates successful return value | notes={{mark c11}}}} | + | {{dcl list item | {{tt|thrd_success}} | indicates successful return value | notes={{mark c11}}}} |
− | {{dcl list item | thrd_busy | indicates unsuccessful return value due to resource temporary unavailable | notes={{mark c11}}}} | + | {{dcl list item | {{tt|thrd_busy}} | indicates unsuccessful return value due to resource temporary unavailable | notes={{mark c11}}}} |
− | {{dcl list item | thrd_nomem | indicates unsuccessful return value due to out of memory condition | notes={{mark c11}}}} | + | {{dcl list item | {{tt|thrd_nomem}} | indicates unsuccessful return value due to out of memory condition | notes={{mark c11}}}} |
− | {{dcl list item | thrd_error | indicates unsuccessful return value | notes={{mark c11}}}} | + | {{dcl list item | {{tt|thrd_error}} | indicates unsuccessful return value | notes={{mark c11}}}} |
{{dcl list end}} | {{dcl list end}} | ||
Revision as of 07:26, 3 August 2012
If the macro constant __STDC_NO_THREADS__
(C11) is defined by the compiler, the header <threads.h>
and all of the names listed here are not provided.
Contents |
Types
Defined in header
<threads.h> | |
cnd_t
|
condition variable identifier |
thrd_t
|
thread identifier |
tss_t
|
thread-specific storage pointer |
mtx_t
|
mutex identifier |
tss_dtor_t
|
function pointer type used for TSS destructor |
thrd_start_t
|
function pointer type passed to thrd_create |
once_flag
|
the type of the flag used by call_once |
Constants
mtx_plain
|
indicates plain mutex for mtx_init |
mtx_recursive
|
indicates recursive mutex for mtx_init |
mtx_timed
|
indicates timed mutex for mtx_init |
thrd_timedout
|
indicates timed out return value |
thrd_success
|
indicates successful return value |
thrd_busy
|
indicates unsuccessful return value due to resource temporary unavailable |
thrd_nomem
|
indicates unsuccessful return value due to out of memory condition |
thrd_error
|
indicates unsuccessful return value |
Macros
Defined in header
<threads.h> | |
(C11) |
thread local type macro (macro constant) |
(C11) |
initializes a once_flag (macro constant) |
(C11) |
maximum number of times destructors are called (macro constant) |
Functions
Defined in header
<threads.h> | |
(C11) |
creates a thread (function) |
(C11) |
detaches a thread (function) |
(C11) |
obtains the current thread identifier (function) |
(C11) |
checks if two identifiers refer to the same thread (function) |
(C11) |
terminates the calling thread (function) |
(C11) |
blocks until a thread terminates (function) |
(C11) |
suspends execution of the calling thread for the given period of time (function) |
(C11) |
yields the current time slice (function) |
(C11) |
calls a function exactly once (function) |
(C11) |
creates a condition variable (function) |
(C11) |
unblocks one thread blocked on a condition variable (function) |
(C11) |
unblocks all threads blocked on a condition variable (function) |
(C11) |
blocks on a condition variable (function) |
(C11) |
blocks on a condition variable, with a timeout (function) |
(C11) |
destroys a condition variable (function) |
(C11) |
creates a mutex (function) |
(C11) |
blocks until locks a mutex (function) |
(C11) |
blocks until locks a mutex or times out (function) |
(C11) |
locks a mutex or returns without blocking if already locked (function) |
(C11) |
unlocks a mutex (function) |
(C11) |
destroys a mutex (function) |
(C11) |
creates thread-specific storage pointer with a given destructor (function) |
(C11) |
reads from thread-specific storage (function) |
(C11) |
write to thread-specific storage (function) |
(C11) |
releases the resources held by a given thread-specific pointer (function) |