Namespaces
Variants
Views
Actions

Thread support library

From cppreference.com
< c
Revision as of 12:16, 4 June 2014 by Newatthis (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

[edit] Threads

Defined in header <threads.h>
thrd_t a type identifying a thread [edit]
creates a thread
(function) [edit]
checks if two identifiers refer to the same thread
(function) [edit]
obtains the current thread identifier
(function) [edit]
suspends execution of the calling thread for the given period of time
(function) [edit]
yields the current time slice
(function) [edit]
terminates the calling thread
(function) [edit]
detaches a thread
(function) [edit]
blocks until a thread terminates
(function) [edit]
indicates a thread error status
(constant) [edit]
thrd_start_t
(C11)
a typedef of the function pointer type int(*)(void*), used by thrd_create
(typedef) [edit]

[edit] Mutual exclusion

Defined in header <threads.h>
mtx_t mutex identifier [edit]
creates a mutex
(function) [edit]
blocks until locks a mutex
(function) [edit]
blocks until locks a mutex or times out
(function) [edit]
locks a mutex or returns without blocking if already locked
(function) [edit]
unlocks a mutex
(function) [edit]
destroys a mutex
(function) [edit]
defines the type of a mutex
(enum) [edit]
Call once
once_flag the type of the flag used by call_once [edit]
initializes a once_flag
(macro constant) [edit]
calls a function exactly once
(function) [edit]

[edit] Condition variables

Defined in header <threads.h>
cnd_t condition variable identifier
creates a condition variable
(function) [edit]
unblocks one thread blocked on a condition variable
(function) [edit]
unblocks all threads blocked on a condition variable
(function) [edit]
blocks on a condition variable
(function) [edit]
blocks on a condition variable, with a timeout
(function) [edit]
destroys a condition variable
(function) [edit]

[edit] Thread-local storage

Defined in header <threads.h>
thread local type macro
(macro constant) [edit]
tss_t thread-specific storage pointer [edit]
maximum number of times destructors are called
(macro constant) [edit]
tss_dtor_t function pointer type used for TSS destructor [edit]
creates thread-specific storage pointer with a given destructor
(function) [edit]
reads from thread-specific storage
(function) [edit]
write to thread-specific storage
(function) [edit]
releases the resources held by a given thread-specific pointer
(function) [edit]

[edit] See also

C++ documentation for Thread support library