diff --git a/src/thread/cancellation.c b/src/thread/cancellation.c index 23d23d14ef2c63683f44662ed2cb48c5771ac906..ab7eebcc02a43e5fc75b315acb98ac7f5b137f8f 100644 --- a/src/thread/cancellation.c +++ b/src/thread/cancellation.c @@ -5,6 +5,8 @@ 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); } diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c index d84e50a96deaaf19e1a79fea198422e49535cde4..0e1dbb2d2e75adcd8299b6b48dc960a5b9c846bc 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; }