diff options
author | Neal H. Walfield <neal@gnu.org> | 2005-05-04 16:04:06 +0000 |
---|---|---|
committer | Neal H. Walfield <neal@gnu.org> | 2005-05-04 16:04:06 +0000 |
commit | f19e83eb2a17d0e87b90a050e7550e1e6985196f (patch) | |
tree | bc968bbd260b351e675ddbab73647d36a0b3d89a /pthread/pt-internal.h | |
parent | 81cb5487d08c59fca0190cf03a07bdf45fe90ea8 (diff) |
libpthread/
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.
Diffstat (limited to 'pthread/pt-internal.h')
-rw-r--r-- | pthread/pt-internal.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/pthread/pt-internal.h b/pthread/pt-internal.h index 75631db..e908695 100644 --- a/pthread/pt-internal.h +++ b/pthread/pt-internal.h @@ -195,16 +195,26 @@ extern int __pthread_setup (struct __pthread *thread, void *(*start_routine)(void *), void *arg); -/* Allocate a kernel thread for THREAD; it must not be placed on the - run queue. */ +/* Allocate a kernel thread (and any miscellaneous system dependent + resources) for THREAD; it must not be placed on the run queue. */ extern int __pthread_thread_alloc (struct __pthread *thread); +/* Deallocate any kernel resources associated with THREAD except don't + halt the thread itself. On return, the thread will be marked as + dead and __pthread_halt will be called. */ +extern void __pthread_thread_dealloc (struct __pthread *thread); + /* Start THREAD making it eligible to run. */ extern int __pthread_thread_start (struct __pthread *thread); -/* Stop thread thread and deallocate any kernel resources associated - with THREAD. */ -extern void __pthread_thread_halt (struct __pthread *thread); +/* Stop the kernel thread associated with THREAD. If NEED_DEALLOC is + true, the function must call __pthread_dealloc on THREAD. + + NB: The thread executing this function may be the thread which is + being halted, thus the last action should be halting the thread + itself. */ +extern void __pthread_thread_halt (struct __pthread *thread, + int need_dealloc); /* Block THREAD. */ |