reorganize thread exit code, make pthread_exit call cancellation handlers (pt2)
[musl] / src / thread / cancellation.c
1 #include "pthread_impl.h"
2
3 void __pthread_register_cancel(struct __ptcb *cb)
4 {
5         struct pthread *self = pthread_self();
6         cb->__next = self->cancelbuf;
7         self->cancelbuf = cb;
8 }
9
10 void __pthread_unregister_cancel(struct __ptcb *cb)
11 {
12         struct pthread *self = __pthread_self();
13         self->cancelbuf = self->cancelbuf->__next;
14 }