summaryrefslogtreecommitdiff
path: root/libpager/seqnos.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpager/seqnos.c')
-rw-r--r--libpager/seqnos.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/libpager/seqnos.c b/libpager/seqnos.c
index 94cce93b..7d8bcba7 100644
--- a/libpager/seqnos.c
+++ b/libpager/seqnos.c
@@ -1,5 +1,5 @@
/* Sequence number synchronization routines for pager library
- Copyright (C) 1994 Free Software Foundation
+ Copyright (C) 1994, 2011 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
@@ -23,7 +23,7 @@
return. */
void
_pager_wait_for_seqno (struct pager *p,
- int seqno)
+ mach_port_seqno_t seqno)
{
while (seqno != p->seqno + 1)
{
@@ -37,7 +37,7 @@ _pager_wait_for_seqno (struct pager *p,
_pager_wait_for_seqno) to be handled. */
void
_pager_release_seqno (struct pager *p,
- int seqno)
+ mach_port_seqno_t seqno)
{
assert (seqno == p->seqno + 1);
p->seqno = seqno;
@@ -47,3 +47,23 @@ _pager_release_seqno (struct pager *p,
condition_broadcast (&p->wakeup);
}
}
+
+
+/* Just update the seqno. */
+void
+_pager_update_seqno (mach_port_t object,
+ mach_port_seqno_t seqno)
+{
+ struct pager *p;
+
+ p = ports_lookup_port (0, object, _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);
+ }
+}