diff options
author | neal <neal> | 2007-11-23 13:47:04 +0000 |
---|---|---|
committer | neal <neal> | 2007-11-23 13:47:04 +0000 |
commit | 0ef832a18d51cf246d1200a8085ea823d274e5b4 (patch) | |
tree | 10dad76d0e5d40f750933d4f5bdbc700402135b0 /libpthread/sysdeps/l4/pt-block.c | |
parent | 063d8339dfe16b6035375a00f3a6313f2dff083c (diff) |
2007-11-23 Neal H. Walfield <neal@gnu.org>
* pthread/pt-internal.h (__pthread_startup): Add declaration.
* pthread/pt-create.c (entry_point): Call __pthread_startup.
* sysdeps/l4/hurd/pt-sysdep.h: Include <hurd/storage.h> and
<sys/mman.h>.
(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 <hurd/stddef.h>.
(__pthread_block): Detect IPC failure. Add debugging output.
* sysdeps/l4/pt-wakeup.c: Include <hurd/stddef.h>.
(__pthread_wakeup): Detect IPC failure. Add debugging output.
Diffstat (limited to 'libpthread/sysdeps/l4/pt-block.c')
-rw-r--r-- | libpthread/sysdeps/l4/pt-block.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libpthread/sysdeps/l4/pt-block.c b/libpthread/sysdeps/l4/pt-block.c index 933cc28..df3fe85 100644 --- a/libpthread/sysdeps/l4/pt-block.c +++ b/libpthread/sysdeps/l4/pt-block.c @@ -21,9 +21,24 @@ #include <pt-internal.h> +#include <hurd/stddef.h> + /* Block THREAD. */ void __pthread_block (struct __pthread *thread) { - L4_Receive (L4_anylocalthread); + debug (5, "%x.%x blocking", + l4_thread_no (thread->threadid), l4_version (thread->threadid)); + + l4_msg_tag_t tag = l4_receive (l4_anythread); + if (l4_ipc_failed (tag)) + { + int err = l4_error_code (); + debug (1, "%x.%x failed to block: %s (%d)", + l4_thread_no (l4_myself ()), l4_version (l4_myself ()), + l4_strerror (err), err); + } + else + debug (5, "%x.%x unblocked", + l4_thread_no (thread->threadid), l4_version (thread->threadid)); } |