diff options
author | Neal H. Walfield <neal@gnu.org> | 2002-11-18 22:20:58 +0000 |
---|---|---|
committer | Neal H. Walfield <neal@gnu.org> | 2002-11-18 22:20:58 +0000 |
commit | a59f26424348f0caf9a3666f9b6ac12565e425e1 (patch) | |
tree | d99c5bc66516cc566de61ba003ec3655fe9368dc /sysdeps/mach/hurd/i386/pt-setup.c | |
parent | 92d94f2528ad27aaa1b2753f96ea95d7bb7f71d9 (diff) |
2002-11-18 Neal H. Walfield <neal@cs.uml.edu>
* 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 <mach.h>.
(__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.
Diffstat (limited to 'sysdeps/mach/hurd/i386/pt-setup.c')
-rw-r--r-- | sysdeps/mach/hurd/i386/pt-setup.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/i386/pt-setup.c b/sysdeps/mach/hurd/i386/pt-setup.c index a249504..369a28e 100644 --- a/sysdeps/mach/hurd/i386/pt-setup.c +++ b/sysdeps/mach/hurd/i386/pt-setup.c @@ -1,5 +1,5 @@ /* Setup thread stack. Hurd/i386 version. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,6 +19,7 @@ #include <stdint.h> #include <assert.h> +#include <mach.h> #include <pt-internal.h> @@ -83,17 +84,20 @@ __pthread_setup (struct __pthread *thread, void *(*start_routine)(void *), void *arg) { error_t err; + mach_port_t ktid; thread->mcontext.pc = entry_point; thread->mcontext.sp = stack_setup (thread, start_routine, arg); - if (thread->kernel_thread != __mach_thread_self ()) + ktid = __mach_port_self (); + if (thread->kernel_thread != ktid) { err = __thread_set_pcsp (thread->kernel_thread, 1, thread->mcontext.pc, 1, thread->mcontext.sp); assert_perror (err); } + __mach_port_deallocate (__mach_task_self (), ktid); return 0; } |