1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <errno.h> #include <pthread.h> #include "thread_internal.h" void pthread_testcancel() { _pthread_descr thread; __THREAD_INIT(); thread=__thread_self(); if (thread->canceled) { pthread_exit(PTHREAD_CANCELED); } }