diff options
author | Marcus Brinkmann <marcus@gnu.org> | 2002-01-18 15:37:22 +0000 |
---|---|---|
committer | Marcus Brinkmann <marcus@gnu.org> | 2002-01-18 15:37:22 +0000 |
commit | 78726377e4cc74b0ec1b1d0ccfac81a048e3858a (patch) | |
tree | de42d63333ee65b69e65bfa1b465d3e24329050c /libpager/demuxer.c | |
parent | 10db2ca377cb71644255405dcadef7fa9d19660d (diff) | |
download | hurd-78726377e4cc74b0ec1b1d0ccfac81a048e3858a.tar.gz hurd-78726377e4cc74b0ec1b1d0ccfac81a048e3858a.tar.bz2 hurd-78726377e4cc74b0ec1b1d0ccfac81a048e3858a.zip |
2001-01-16 Marcus Brinkmann <marcus@gnu.org>
* demuxer.c (pager_demuxer): If the message was not accepted by
one of the servers, acquire a reference to the pager and its lock,
and wait until all previous messages have been processed. This
makes sure that the next message that arrives can proceed.
Reported by Neal H Walfield <neal@cs.uml.edu>
Diffstat (limited to 'libpager/demuxer.c')
-rw-r--r-- | libpager/demuxer.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/libpager/demuxer.c b/libpager/demuxer.c index f233d1c0..0bd56b4e 100644 --- a/libpager/demuxer.c +++ b/libpager/demuxer.c @@ -1,5 +1,5 @@ /* Demuxer for pager library - Copyright (C) 1994, 1995 Free Software Foundation + Copyright (C) 1994, 1995, 2002 Free Software Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -20,7 +20,7 @@ #include "notify_S.h" /* Demultiplex a single message directed at a pager port; INP is the - message received; fille OUTP with the reply. */ + message received; fill OUTP with the reply. */ int pager_demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp) @@ -30,7 +30,24 @@ pager_demuxer (mach_msg_header_t *inp, extern int _pager_seqnos_notify_server (mach_msg_header_t *inp, mach_msg_header_t *outp); - return (_pager_seqnos_memory_object_server (inp, outp) - || _pager_seqnos_notify_server (inp, outp)); + int result = _pager_seqnos_memory_object_server (inp, outp) + || _pager_seqnos_notify_server (inp, outp); + if (!result) + { + struct pager *p; + + p = ports_lookup_port (0, inp->msgh_remote_port, _pager_class); + if (p) + { + mutex_lock (&p->interlock); + _pager_wait_for_seqno (p, seqno); + _pager_release_seqno (p, seqno); + mutex_unlock (&p->interlock); + ports_port_deref (p); + } + } + return result; } + + |