#include <thread.h> thread_t tid; thread_t departedid; int ret; void *status; /* 切り離されていないスレッドの終了待ち、status の指定あり */ ret = thr_join(0, &departedid, &status); |
thr_join() でスレッド識別子としてゼロを指定すると、プロセス内の切り離されていない任意のスレッドの終了を待ちます。departedid には、終了したスレッドのスレッド識別子が格納されます。