diff options
author | neal <neal> | 2008-06-22 09:16:43 +0000 |
---|---|---|
committer | neal <neal> | 2008-06-22 09:16:43 +0000 |
commit | 61edfb886d649a07416a89b4294be738cdb4d061 (patch) | |
tree | ed30937d24cd854a8cecf8121e9ae9d94ce60690 /viengoos/thread.h | |
parent | 25f5fdaa9e28b4e768bc5c28435b3275bb60d886 (diff) |
viengoos/
2008-06-22 Neal H. Walfield <neal@gnu.org>
* thread.h: Include "list.h".
(struct thread) [! NDEBUG]: Add field futex_waiter_node.
[! NDEBUG]: Instantiate the futex_waiter list class.
(futex_waiters) [! NDEBUG]: Declare.
* server.c (futex_waiters) [! NDEBUG]: New variable.
(server_loop) [! NDEBUG]: If we don't get an RPC for a while,
dequeue all thread's enqueued on FUTEX_WAITERS and return EDEADLK.
When blocking a thread on a futex, add THREAD to FUTEX_WAITERS.
* object.c (object_wait_queue_dequeue) [! NDEBUG]: If
THREAD->WAIT_REASON is THREAD_WAIT_FUTEX, unlink THREAD from
FUTEX_WAITERS.
hurd/
2008-06-22 Neal H. Walfield <neal@gnu.org>
* futex.h [! RM_INTERN]: Include <errno.h>.
(futex_wait): On error, set ERRNO and return -1.
(futex_timed_wait): Likewise.
(futex_wake): Likewise.
* mutex.h (ss_mutex_lock): If FUTEX_WAIT returns failure, print
some debugging information.
Diffstat (limited to 'viengoos/thread.h')
-rw-r--r-- | viengoos/thread.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/viengoos/thread.h b/viengoos/thread.h index 7ce235f..2d6cb63 100644 --- a/viengoos/thread.h +++ b/viengoos/thread.h @@ -1,5 +1,5 @@ /* thread.h - Thread object interface. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007, 2008 Free Software Foundation, Inc. Written by Neal H. Walfield <neal@gnu.org>. This file is part of the GNU Hurd. @@ -24,6 +24,8 @@ #include <l4.h> #include <errno.h> +#include "list.h" + /* Forward. */ struct folio; struct activity; @@ -107,8 +109,18 @@ struct thread oid_t next; oid_t prev; } wait_queue; + +#ifndef NDEBUG + struct list_node futex_waiter_node; +#endif }; +#ifndef NDEBUG +LIST_CLASS(futex_waiter, struct thread, futex_waiter_node, true) +/* List of threads waiting on a futex. */ +extern struct futex_waiter_list futex_waiters; +#endif + /* The hardwired base of the UTCB (2.5GB). */ #define UTCB_AREA_BASE (0xA0000000) /* The size of the UTCB. */ |