From 78726377e4cc74b0ec1b1d0ccfac81a048e3858a Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Fri, 18 Jan 2002 15:37:22 +0000 Subject: 2001-01-16 Marcus Brinkmann * 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 --- libpager/ChangeLog | 8 ++++++++ libpager/demuxer.c | 25 +++++++++++++++++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) (limited to 'libpager') diff --git a/libpager/ChangeLog b/libpager/ChangeLog index a66014e8..1d0308a1 100644 --- a/libpager/ChangeLog +++ b/libpager/ChangeLog @@ -1,3 +1,11 @@ +2001-01-16 Marcus Brinkmann + + * 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 + 2001-12-29 Roland McGrath * data-init.c, object-create.c: Removed obsolete files. 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; } + + -- cgit v1.2.3