int pthread_cancel(pthread_t thread);
#include <pthread.h> pthread_t thread; int ret; ret = pthread_cancel(thread);
取り消し要求がどのように扱われるかは、対象となるスレッドの状態によって異なります。その状態を判定する関数として、pthread_setcancelstate(3C) と pthread_setcanceltype(3C) があります。