Standard library header <threads.h> (C11)
From cppreference.net
このヘッダは 並行性サポートライブラリ の一部であり、スレッド、相互排他、条件変数、およびスレッド固有ストレージのサポートを提供します。
目次 |
スレッド
thrd_t
|
スレッドを識別する実装定義の完全オブジェクト型 |
|
(C11)
|
スレッドを作成する
(関数) |
|
(C11)
|
2つの識別子が同じスレッドを参照しているかチェックする
(関数) |
|
(C11)
|
現在のスレッド識別子を取得する
(関数) |
|
(C11)
|
呼び出しスレッドの実行を指定された期間一時停止する
(関数) |
|
(C11)
|
現在のタイムスライスを明け渡す
(関数) |
|
(C11)
|
呼び出しスレッドを終了する
(関数) |
|
(C11)
|
スレッドをデタッチする
(関数) |
|
(C11)
|
スレッドが終了するまでブロックする
(関数) |
|
スレッドエラーステータスを示す
(定数) |
|
|
thrd_start_t
(C11)
|
関数ポインタ型
int
(
*
)
(
void
*
)
のtypedef、
thrd_create
で使用される
(typedef) |
相互排他
mtx_t
|
ミューテックス識別子 |
|
(C11)
|
ミューテックスを作成する
(関数) |
|
(C11)
|
ミューテックスをロックするまでブロックする
(関数) |
|
(C11)
|
ミューテックスをロックするかタイムアウトするまでブロックする
(関数) |
|
(C11)
|
ミューテックスをロックするか、既にロックされている場合はブロックせずに返す
(関数) |
|
(C11)
|
ミューテックスをアンロックする
(関数) |
|
(C11)
|
ミューテックスを破棄する
(関数) |
|
(C11)
(C11)
(C11)
|
ミューテックスの型を定義する
(列挙型) |
一度だけ呼び出し |
|
|
(C11)
|
関数を正確に一度だけ呼び出す
(関数) |
条件変数
cnd_t
|
条件変数識別子 |
|
(C11)
|
条件変数を作成する
(関数) |
|
(C11)
|
条件変数でブロックされている1つのスレッドのブロックを解除する
(関数) |
|
(C11)
|
条件変数でブロックされているすべてのスレッドのブロックを解除する
(関数) |
|
(C11)
|
条件変数でブロックする
(関数) |
|
(C11)
|
条件変数でブロックする(タイムアウト付き)
(関数) |
|
(C11)
|
条件変数を破棄する
(関数) |
スレッドローカルストレージ
|
(C11)
(removed in C23)
|
ストレージクラス指定子
_Thread_local
の便利マクロ
(キーワードマクロ) |
tss_t
|
スレッド固有ストレージポインタ |
|
(C11)
|
デストラクタが呼び出される最大回数
(マクロ定数) |
tss_dtor_t
(C11)
|
関数ポインタ型
void
(
*
)
(
void
*
)
、TSSデストラクタに使用される
(typedef) |
|
(C11)
|
指定されたデストラクタでスレッド固有ストレージポインタを作成する
(関数) |
|
(C11)
|
スレッド固有ストレージから読み取る
(関数) |
|
(C11)
|
スレッド固有ストレージに書き込む
(関数) |
|
(C11)
|
指定されたスレッド固有ポインタが保持するリソースを解放する
(関数) |
概要
#define __STDC_NO_THREADS__ 202311L #define ONCE_FLAG_INIT /* 説明を参照 */ #define TSS_DTOR_ITERATIONS /* 説明を参照 */ typedef /* 説明を参照 */ cnd_t; typedef /* 説明を参照 */ thrd_t; typedef /* 説明を参照 */ tss_t; typedef /* 説明を参照 */ mtx_t; typedef /* 説明を参照 */ tss_dtor_t; typedef /* 説明を参照 */ thrd_start_t; #define mtx_plain /* 説明を参照 */ #define mtx_recursive /* 説明を参照 */ #define mtx_timed /* 説明を参照 */ #define once_flag /* 説明を参照 */ #define thrd_busy /* 説明を参照 */ #define thrd_error /* 説明を参照 */ #define thrd_nomem /* 説明を参照 */ #define thrd_success /* 説明を参照 */ #define thrd_timedout /* 説明を参照 */ void call_once(once_flag* flag, void (*func)(void)); int cnd_broadcast(cnd_t* cond); void cnd_destroy(cnd_t* cond); int cnd_init(cnd_t* cond); int cnd_signal(cnd_t* cond); int cnd_timedwait(cnd_t* restrict cond, mtx_t* restrict mtx, const struct timespec* restrict ts); int cnd_wait(cnd_t* cond, mtx_t* mtx); void mtx_destroy(mtx_t* mtx); int mtx_init(mtx_t* mtx, int type); int mtx_lock(mtx_t* mtx); int mtx_timedlock(mtx_t* restrict mtx, const struct timespec* restrict ts); int mtx_trylock(mtx_t* mtx); int mtx_unlock(mtx_t* mtx); int thrd_create(thrd_t* thr, thrd_start_t func, void* arg); thrd_t thrd_current(void); int thrd_detach(thrd_t thr); int thrd_equal(thrd_t thr0, thrd_t thr1); [[noreturn]] void thrd_exit(int res); int thrd_join(thrd_t thr, int* res); int thrd_sleep(const struct timespec* duration, struct timespec* remaining); void thrd_yield(void); int tss_create(tss_t* key, tss_dtor_t dtor); void tss_delete(tss_t key); void* tss_get(tss_t key); int tss_set(tss_t key, void* val);