diff options
Diffstat (limited to 'sysdeps/mach/hurd/pt-docancel.c')
-rw-r--r-- | sysdeps/mach/hurd/pt-docancel.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sysdeps/mach/hurd/pt-docancel.c b/sysdeps/mach/hurd/pt-docancel.c index 58524ff0..bac62a71 100644 --- a/sysdeps/mach/hurd/pt-docancel.c +++ b/sysdeps/mach/hurd/pt-docancel.c @@ -30,10 +30,17 @@ call_exit (void) int __pthread_do_cancel (struct __pthread *p) { + mach_port_t ktid; + int me; + assert (p->cancel_pending = 1); assert (p->cancel_state == PTHREAD_CANCEL_ENABLE); - if (__mach_thread_self () == p->kernel_thread) + ktid = __mach_thread_self (); + me = p->kernel_thread == ktid; + __mach_port_deallocate (__mach_task_self (), ktid); + + if (me) call_exit (); else { |