From 8951cdfc28792b0a761269b1716ca50558ec7b7c Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Wed, 1 Jun 1994 16:57:29 +0000 Subject: entered into RCS --- libpager/seqnos.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libpager') diff --git a/libpager/seqnos.c b/libpager/seqnos.c index 62db626d..94cce93b 100644 --- a/libpager/seqnos.c +++ b/libpager/seqnos.c @@ -16,28 +16,31 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "priv.h" +#include /* The message with seqno SEQNO has just been dequeued for pager P; wait until all preceding messages have had a chance and then return. */ void _pager_wait_for_seqno (struct pager *p, - int seqno) + int seqno) { while (seqno != p->seqno + 1) { p->waitingforseqno = 1; condition_wait (&p->wakeup, &p->interlock); } - p->seqno = seqno; } /* Allow the next message for pager P (potentially blocked in _pager_wait_for_seqno) to be handled. */ void -_pager_release_seqno (struct pager *p) +_pager_release_seqno (struct pager *p, + int seqno) { + assert (seqno == p->seqno + 1); + p->seqno = seqno; if (p->waitingforseqno) { p->waitingforseqno = 0; -- cgit v1.2.3