マルチスレッドのプログラミング

thr_continue(3T)

thr_continue(3T) は、停止しているスレッドの実行を再開します。再開したスレッドに対して再度 thr_continue() を発行しても効果はありません。


#include <thread.h>

int thr_continue(thread_t tid);

停止しているスレッドがシグナルで呼び起こされることはありません。送られたシグナルは、そのスレッドが thr_continue() で再開されるまで保留されます。

pthread で定義されている pthread_t tid と Solaris スレッドの thread_t tid が同じです。tid 値は、代入によっても型変換によっても使用できます。


thread_t tid; /* thr_create() からの tid */

/* pthread_create() で生成されたスレッドからの Solaris tid に */
/* 相当する pthread */
pthread_t ptid;	

int ret;

ret = thr_continue(tid);

/* 型変換で pthread ID 変数を使用する */
ret = thr_continue((thread_t) ptid)	

戻り値

正常終了時は 0 です。それ以外の戻り値は、エラーが発生したことを示します。以下の条件が検出されると、thr_continue() は失敗し、対応する値を戻します。


ESRCH

現在のプロセスに tid が存在しません。