From d86c6cbabce7b698aa0b93bf40c16afe248f3733 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 1 Jan 2014 18:10:50 +0100 Subject: 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. --- sysdeps/mach/pt-thread-terminate.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sysdeps/mach/pt-thread-terminate.c') 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); } -- cgit v1.2.3