missed detail in cancellation bloat fix
[musl] / src / thread / cancellation.c
1 #include "pthread_impl.h"
2
3 #ifdef __pthread_register_cancel
4 #undef __pthread_register_cancel
5 #undef __pthread_unregister_cancel
6 #undef __pthread_unwind_next
7 #define __pthread_register_cancel __pthread_register_cancel_3
8 #define __pthread_unregister_cancel __pthread_unregister_cancel_3
9 #define __pthread_unwind_next __pthread_unwind_next_3
10 #endif
11
12 static void dummy(struct __ptcb *cb)
13 {
14 }
15 weak_alias(dummy, __pthread_do_unwind);
16
17 void __pthread_unwind_next(struct __ptcb *cb)
18 {
19         __pthread_do_unwind(cb);
20 }
21
22 void __pthread_register_cancel(struct __ptcb *cb)
23 {
24         struct pthread *self = pthread_self();
25         cb->__next = self->cancelbuf;
26         self->cancelbuf = cb;
27 }
28
29 void __pthread_unregister_cancel(struct __ptcb *cb)
30 {
31         struct pthread *self = __pthread_self();
32         self->cancelbuf = self->cancelbuf->__next;
33 }