pthread_setcancelstate.c 272 B

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