summaryrefslogtreecommitdiff
path: root/sysdeps/l4/pt-wakeup.c
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@gnu.org>2007-11-23 13:47:05 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-04-07 23:10:46 +0200
commite771f19810d1e1555f0921bc6185067fc12f6409 (patch)
treecb848bdb690af5262056b8004be3000e838ef5a9 /sysdeps/l4/pt-wakeup.c
parent71801fe4ab9e6e443327329ddf430d350d2d33e2 (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 'sysdeps/l4/pt-wakeup.c')
-rw-r--r--sysdeps/l4/pt-wakeup.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sysdeps/l4/pt-wakeup.c b/sysdeps/l4/pt-wakeup.c
index 342a220..7ecc938 100644
--- a/sysdeps/l4/pt-wakeup.c
+++ b/sysdeps/l4/pt-wakeup.c
@@ -21,9 +21,27 @@
#include <pt-internal.h>
+#include <hurd/stddef.h>
+
/* Wakeup THREAD. */
void
__pthread_wakeup (struct __pthread *thread)
{
- l4_send (thread->threadid);
+ debug (5, "%x.%x waking %x.%x",
+ l4_thread_no (l4_myself ()), l4_version (l4_myself ()),
+ l4_thread_no (thread->threadid), l4_version (thread->threadid));
+
+ l4_msg_tag_t tag = l4_send (thread->threadid);
+ if (l4_ipc_failed (tag))
+ {
+ int err = l4_error_code ();
+ debug (1, "%x.%x failed to wake %x.%x: %s (%d)",
+ l4_thread_no (l4_myself ()), l4_version (l4_myself ()),
+ l4_thread_no (thread->threadid), l4_version (thread->threadid),
+ l4_strerror (err), err);
+ }
+ else
+ debug (5, "%x.%x woke %x.%x",
+ l4_thread_no (l4_myself ()), l4_version (l4_myself ()),
+ l4_thread_no (thread->threadid), l4_version (thread->threadid));
}