pthread_exit(PTHREAD_CANCELED);
__pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME);
int pthread_setcancelstate(int state, int * oldstate){  pthread_descr self = thread_self();  if (state < PTHREAD_CANCEL_ENABLE || state > PTHREAD_CANCEL_DISABLE)    return EINVAL;  if (oldstate != NULL) *oldstate = THREAD_GETMEM(self, p_cancelstate);  THREAD_SETMEM(self, p_cancelstate, state);  if (THREAD_GETMEM(self, p_canceled) &&      THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE &&      THREAD_GETMEM(self, p_canceltype) == PTHREAD_CANCEL_ASYNCHRONOUS)    pthread_exit(PTHREAD_CANCELED);  return 0;}