Age | Commit message (Collapse) | Author |
|
* sysdeps/mach/pt-thread-alloc.c (__pthread_thread_alloc): Set
THREAD->HAVE_KERNEL_RESOURCES to 1, not true. Reported by Flávio
Cruz <Flávio Cruz>.
|
|
* pthread/pt-alloc.c: Don't include <bits/atomic.h>.
(__pthread_free_threads): Change to a struct __pthread *.
(__pthread_free_threads_lock): New variable.
(__pthread_alloc): When looking for a TCB to reuse, iterate over
__pthread_free_threads taking the first for which the STATE field
is PTHREAD_TERMINATED. When reusing a TCB, first call
__pthread_thread_halt on it.
* pthread/pt-dealloc.c: Don't include <bits/atomic.h>.
(__pthread_free_threads): Change to a struct __pthread *.
(__pthread_free_threads_lock): New declaration.
(__pthread_dealloc): Enqueue PTHREAD on __PTHREAD_FREE_THREADS.
Set PTHREAD->STATE to PTHREAD_TERMINATED after everything else.
* pthread/pt-join.c (pthread_join): Call __pthread_thread_halt
before destroying the thread. When destroying the thread, call
__pthread_thread_dealloc on it.
* pthread/pt-detach.c (pthread_detach): If destroying the thread,
call __pthread_thread_halt before deallocating the stack. In this
case, also call __pthread_thread_dealloc on the tcb.
* pthread/pt-exit.c (pthread_exit): Call __pthread_dealloc only if
the thread is detached and then as the last thing we do before
calling __pthread_thread_halt.
* pthread/pt-internal.h (__pthread_thread_halt): Remove argument
NEED_DEALLOC. Update users.
* sysdeps/mach/pt-thread-halt.c (__pthread_thread_halt): Remove
argument need_dealloc.
* sysdeps/mach/hurd/pt-sysdep.h (PTHREAD_SYSDEP_MEMBERS): Add field
have_kernel_resources.
* sysdeps/mach/hurd/pt-thread-alloc.c (__pthread_thread_alloc): If
THREAD->HAVE_KERNEL_RESOURCES is true, just return. After
allocating the resources, set THREAD->HAVE_KERNEL_RESOURCES to
true.
|
|
2005-05-04 Neal H. Walfield <neal@gnu.org>
* Makefile (SRCS): Add pt-thread_dealloc.c.
* sysdeps/mach/pt-thread-dealloc.c: New file.
* pthread/pt-internal.h (__pthread_thread_dealloc): New
declaration.
(__pthread_thread_halt): Add parameter NEED_DEALLOC. Update
callers.
* sysdeps/mach/pt-thread-halt.c (__pthread_thread_halt): Respect
new NEED_DEALLOC parameter. Move code which deallocates kernel
resources from here ...
* sysdeps/mach/pt-thread-dealloc.c (__pthread_thread_dealloc):
...to here.
* pthread/pt-create.c (__pthread_create_internal): Call
__pthread_thread_dealloc on failure.
* pthread/pt-exit.c (pthread_exit): Call __pthread_thread_dealloc.
* sysdeps/mach/pt-thread-alloc.c (create_wakeupmsg): Call
__mach_port_destroy to deallocate the receive right.
__mach_port_deallocate won't do it.
* pthread/pt-detach.c (pthread_detach): Don't call
__pthread_thread_halt a second time.
* sysdeps/mach/hurd/pt-sysdep.c (_cthread_init_routine): Fix
declaration.
(init_routine): Update declaration and remove gratuitous cast.
|
|
* 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.
|
|
|