pthread_setcanceltype.c 253 B

1234567891011
  1. #include "pthread_impl.h"
  2. int pthread_setcanceltype(int new, int *old)
  3. {
  4. struct pthread *self = __pthread_self();
  5. if (new > 1U) return EINVAL;
  6. if (old) *old = self->cancelasync;
  7. self->cancelasync = new;
  8. if (new) pthread_testcancel();
  9. return 0;
  10. }