summaryrefslogtreecommitdiff
path: root/sysdeps/mach/pt-thread-terminate.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-01-01 18:10:50 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-01-01 18:10:50 +0100
commitd86c6cbabce7b698aa0b93bf40c16afe248f3733 (patch)
treeeda22947258e882327d42ed006bcfb34797fc63e /sysdeps/mach/pt-thread-terminate.c
parent983b18a6ff16f5687a9ece63a50d1831dec88609 (diff)
Add compatibility with kernels without __thread_terminate_release
This would leak, but at least let the user reboot nicely into a newer kernel. * sysdeps/mach/pt-thread-terminate.c (__pthread_thread_terminate): If __thread_terminate_release returns, use __thread_terminate to terminate the thread anyway.
Diffstat (limited to 'sysdeps/mach/pt-thread-terminate.c')
-rw-r--r--sysdeps/mach/pt-thread-terminate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/mach/pt-thread-terminate.c b/sysdeps/mach/pt-thread-terminate.c
index a89e505..b9d08fc 100644
--- a/sysdeps/mach/pt-thread-terminate.c
+++ b/sysdeps/mach/pt-thread-terminate.c
@@ -68,5 +68,11 @@ __pthread_thread_terminate (struct __pthread *thread)
err = __thread_terminate_release (kernel_thread, mach_task_self (),
kernel_thread, reply_port,
stackaddr, stacksize);
+
+ /* The kernel does not support it yet. Leak but at least terminate
+ correctly. */
+ err = __thread_terminate (kernel_thread);
+
+ /* We are out of luck. */
assert_perror (err);
}