名前空間
変種
操作

thrd_join

提供: cppreference.com
< c‎ | thread
ヘッダ <threads.h> で定義
int thrd_join( thrd_t thr, int *res );
(C11以上)

thr の表すスレッドが実行を終了するまで現在のスレッドをブロックします。

res がヌルポインタでなければ、スレッドの結果コードが res の指す位置に格納されます。

スレッドの終了はこの関数の完了に対して同期します。

スレッドがすでに detach または join されている場合、動作は未定義です。

目次

[編集] 引数

thr - join するスレッドの識別子
res - 結果コードを格納する位置

[編集] 戻り値

成功した場合は thrd_success、そうでなければ thrd_error

[編集] 参考文献

  • C11 standard (ISO/IEC 9899:2011):
  • 7.26.5.6 The thrd_join function (p: 384-385)

[編集] 関連項目

スレッドをデタッチします
(関数) [edit]
呼び出し元のスレッドを終了させます
(関数) [edit]