X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fcancellation.c;h=4976fedcb448bac52427a4dcb25bf59c333e1941;hb=f58c8a0f391987a65e055ae591ec59b9df7b7f7c;hp=e35ba8245d2e38b277b8214939cf003f895a4fa6;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/thread/cancellation.c b/src/thread/cancellation.c index e35ba824..4976fedc 100644 --- a/src/thread/cancellation.c +++ b/src/thread/cancellation.c @@ -1,5 +1,12 @@ #include "pthread_impl.h" +#ifdef __pthread_register_cancel +#undef __pthread_register_cancel +#undef __pthread_unregister_cancel +#define __pthread_register_cancel __pthread_register_cancel_3 +#define __pthread_unregister_cancel __pthread_unregister_cancel_3 +#endif + void __pthread_register_cancel(struct __ptcb *cb) { struct pthread *self = pthread_self(); @@ -7,16 +14,8 @@ void __pthread_register_cancel(struct __ptcb *cb) self->cancelbuf = cb; } -#define pthread_self __pthread_self - void __pthread_unregister_cancel(struct __ptcb *cb) { - struct pthread *self = pthread_self(); + struct pthread *self = __pthread_self(); self->cancelbuf = self->cancelbuf->__next; } - -void __pthread_unwind_next(struct __ptcb *cb) -{ - if (cb->__next) longjmp((void *)cb->__next->__jb, 1); - pthread_exit(PTHREAD_CANCELLED); -}