X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fthread%2Fpthread_create.c;h=c3b65ae955ab2b3757a32cf4f1597b87fb669361;hp=87bf8166ff85242ad890e0832cdc07c3399b7972;hb=58aa5f45ed3282751ae118c107ff008d4df765dc;hpb=afc35d5efde48b82a7786d9c89b115965da6b637 diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c index 87bf8166..c3b65ae9 100644 --- a/src/thread/pthread_create.c +++ b/src/thread/pthread_create.c @@ -46,8 +46,6 @@ void pthread_exit(void *result) void __do_cleanup_push(struct __ptcb *cb, void (*f)(void *), void *x) { struct pthread *self = pthread_self(); - cb->__f = f; - cb->__x = x; cb->__next = self->cancelbuf; self->cancelbuf = cb; } @@ -55,7 +53,6 @@ void __do_cleanup_push(struct __ptcb *cb, void (*f)(void *), void *x) void __do_cleanup_pop(struct __ptcb *cb, int run) { __pthread_self()->cancelbuf = cb->__next; - if (run) cb->__f(cb->__x); } static int start(void *p) @@ -123,6 +120,7 @@ int pthread_create(pthread_t *res, const pthread_attr_t *attr, void *(*entry)(vo new->tsd = (void *)tsd; if (attr) new->detached = attr->_a_detach; new->unblock_cancel = self->cancel; + new->canary = self->canary ^ (uintptr_t)&new; stack = (void *)new; __synccall_lock();