Silphireの日記: pthread日記(75) - pthread_setcancelstate()
日記 by
Silphire
スレッドのキャンセル状態を設定します
int pthread_setcancelstate(int state, int *oldstate);
pthread_setcancelstate()は、呼び出したスレッドのキャンセル状態をstateにし、元のキャンセル状態をoldstateに格納します。stateには、PTHREAD_CANCEL_ENABLEかPTHREAD_CANCEL_DISABLEを与えます。
新しく出来たスレッドのキャンセル状態はPTHREAD_CANCEL_ENABLEです。main()が最初に起動したスレッドも同様です。
pthread_setcancelstate()が成功した時には0を返します。エラーの時はエラーに応じた値を返します。
pthread日記(75) - pthread_setcancelstate() More ログイン