X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fcancellation.c;h=9b21764b56b0bea71300b30dedaf950248135112;hb=121e3a38a1d0b324696fc1671029e4b815ea7fa4;hp=b02cdfb093cc528413cc79f1384f19418335b0d6;hpb=5f37fc132a8f41994f37b6712feb2d4fd34c2be0;p=musl diff --git a/src/thread/cancellation.c b/src/thread/cancellation.c index b02cdfb0..9b21764b 100644 --- a/src/thread/cancellation.c +++ b/src/thread/cancellation.c @@ -3,21 +3,18 @@ static void dummy(struct __ptcb *cb) { } -weak_alias(dummy, __pthread_do_unwind); -weak_alias(dummy, __pthread_do_register); -weak_alias(dummy, __pthread_do_unregister); +weak_alias(dummy, __do_cleanup_push); +weak_alias(dummy, __do_cleanup_pop); -void __pthread_unwind_next(struct __ptcb *cb) +void _pthread_cleanup_push(struct __ptcb *cb, void (*f)(void *), void *x) { - __pthread_do_unwind(cb); + cb->__f = f; + cb->__x = x; + __do_cleanup_push(cb); } -void __pthread_register_cancel(struct __ptcb *cb) +void _pthread_cleanup_pop(struct __ptcb *cb, int run) { - __pthread_do_register(cb); -} - -void __pthread_unregister_cancel(struct __ptcb *cb) -{ - __pthread_do_unregister(cb); + __do_cleanup_pop(cb); + if (run) cb->__f(cb->__x); }