From a59f26424348f0caf9a3666f9b6ac12565e425e1 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Mon, 18 Nov 2002 22:20:58 +0000 Subject: 2002-11-18 Neal H. Walfield * sysdeps/mach/pt-wakeup.c (__pthread_wakeup): Use the size of THREAD->wakeupmsg which may not be a mach_msg_header_t. * sysdeps/generic/pt-mutex-timedlock.c (__pthread_mutex_timedlock_internal): Really test for equality. * sysdeps/generic/pt-rwlock-timedrdlock.c (__pthread_rwlock_timedrdlock_internal): Likewise. * sysdeps/generic/pt-rwlock-timedwrlock.c (__pthread_rwlock_timedwrlock_internal): Likewise. * sysdeps/generic/pt-cond-timedwait.c (__pthread_cond_timedwait_internal): On timeout, remove our thread structure from the wait queue if necessary. * sysdeps/l4/pt-start.c (__pthread_start): Call L4_Myself, not __mach_thread_self. * sysdeps/mach/hurd/i386/pt-setup.c: Include . (__pthread_setup): Do not leak references from __mach_thread_self. * sysdeps/mach/hurd/pt-docancel.c (__pthread_do_cancel): Likewise. * sysdeps/mach/hurd/pt-sysdep.h (_pthread_self): Likewise. * sysdeps/mach/pt-thread-alloc.c (__pthread_thread_alloc): Likewise. * sysdeps/mach/pt-thread-start.c (__pthread_thread_start): Likewise. * sysdeps/mach/pt-start.c: Remove dead file. --- sysdeps/mach/pt-thread-start.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sysdeps/mach/pt-thread-start.c') diff --git a/sysdeps/mach/pt-thread-start.c b/sysdeps/mach/pt-thread-start.c index eade509..11b017f 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 { -- cgit v1.2.3