pthread_setcancelstate.c 291 B

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