__syscall(SYS_exit, 0);
}
-void __do_cleanup_push(struct __ptcb *cb, void (*f)(void *), void *x)
+void __do_cleanup_push(struct __ptcb *cb)
{
struct pthread *self = pthread_self();
- cb->__f = f;
- cb->__x = x;
cb->__next = self->cancelbuf;
self->cancelbuf = cb;
}
-void __do_cleanup_pop(struct __ptcb *cb, int run)
+void __do_cleanup_pop(struct __ptcb *cb)
{
__pthread_self()->cancelbuf = cb->__next;
}
size = guard + ROUND(attr->_a_stacksize + DEFAULT_STACK_SIZE);
}
size += __pthread_tsd_size;
- map = mmap(0, size, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0);
+ map = mmap(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);
if (map == MAP_FAILED) return EAGAIN;
if (guard) mprotect(map, guard, PROT_NONE);
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();