X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fthread%2Fcancellation.c;h=ab7eebcc02a43e5fc75b315acb98ac7f5b137f8f;hp=967705a910a4213b48be5f3ab79e2816cb501c93;hb=e7655ed37bc9c2d79d921af4f287ee5cf2788661;hpb=afc35d5efde48b82a7786d9c89b115965da6b637 diff --git a/src/thread/cancellation.c b/src/thread/cancellation.c index 967705a9..ab7eebcc 100644 --- a/src/thread/cancellation.c +++ b/src/thread/cancellation.c @@ -5,12 +5,15 @@ void __do_cleanup_pop(); void _pthread_cleanup_push(struct __ptcb *cb, void (*f)(void *), void *x) { + cb->__f = f; + cb->__x = x; __do_cleanup_push(cb, f, x); } void _pthread_cleanup_pop(struct __ptcb *cb, int run) { __do_cleanup_pop(cb, run); + if (run) cb->__f(cb->__x); } static void dummy()