diff options
Diffstat (limited to 'sysdeps/mach/pt-thread-start.c')
-rw-r--r-- | sysdeps/mach/pt-thread-start.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sysdeps/mach/pt-thread-start.c b/sysdeps/mach/pt-thread-start.c index eade5098..11b017ff 100644 --- a/sysdeps/mach/pt-thread-start.c +++ b/sysdeps/mach/pt-thread-start.c @@ -33,7 +33,11 @@ __pthread_thread_start (struct __pthread *thread) { /* The main thread is already running: do nothing. */ assert (__pthread_total == 1); - assert (thread->kernel_thread == __mach_thread_self ()); + assert (({ mach_port_t ktid = __mach_thread_self (); + int ok = thread->kernel_thread == ktid; + __mach_port_deallocate (__mach_task_self (), + thread->kernel_thread); + ok; })); } else { |