From 0ef832a18d51cf246d1200a8085ea823d274e5b4 Mon Sep 17 00:00:00 2001 From: neal Date: Fri, 23 Nov 2007 13:47:04 +0000 Subject: 2007-11-23 Neal H. Walfield * pthread/pt-internal.h (__pthread_startup): Add declaration. * pthread/pt-create.c (entry_point): Call __pthread_startup. * sysdeps/l4/hurd/pt-sysdep.h: Include and . (PTHREAD_SYSDEP_MEMBERS): Add fields object, exception_handler_stack and exception_handler_sp. (__attribute__): Call munmap. * sysdeps/l4/hurd/ia32/pt-setup.c (__pthread_setup): Set up thread->exception_handler_sp. Don't set the user define handle here. * sysdeps/l4/hurd/pt-startup.c: New file. Do it here. * sysdeps/l4/hurd/pt-thread-alloc.c: New file. * sysdeps/l4/hurd/pt-thread-halt.c: New file. * sysdeps/l4/hurd/pt-thread-start.c: New file. * Makefile.am (libpthread_a_SOURCES): Add pt-startup.c. * sysdeps/l4/pt-block.c: Include . (__pthread_block): Detect IPC failure. Add debugging output. * sysdeps/l4/pt-wakeup.c: Include . (__pthread_wakeup): Detect IPC failure. Add debugging output. --- libpthread/pthread/pt-create.c | 2 ++ libpthread/pthread/pt-internal.h | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'libpthread/pthread') diff --git a/libpthread/pthread/pt-create.c b/libpthread/pthread/pt-create.c index 4f8d043..5bb9f1f 100644 --- a/libpthread/pthread/pt-create.c +++ b/libpthread/pthread/pt-create.c @@ -45,6 +45,8 @@ entry_point (void *(*start_routine)(void *), void *arg) uselocale (LC_GLOBAL_LOCALE); #endif + __pthread_startup (); + pthread_exit (start_routine (arg)); } diff --git a/libpthread/pthread/pt-internal.h b/libpthread/pthread/pt-internal.h index 0dd4e9a..6d34be1 100644 --- a/libpthread/pthread/pt-internal.h +++ b/libpthread/pthread/pt-internal.h @@ -218,6 +218,10 @@ extern void __pthread_thread_halt (struct __pthread *thread, int need_dealloc); +/* Called by a thread just before it calls the provided start + routine. */ +extern void __pthread_startup (void); + /* Block THREAD. */ extern void __pthread_block (struct __pthread *thread); -- cgit v1.2.3