diff options
author | Thomas Schwinge <thomas@schwinge.name> | 2011-11-24 09:42:28 +0100 |
---|---|---|
committer | Thomas Schwinge <thomas@schwinge.name> | 2011-11-24 09:42:28 +0100 |
commit | 3253311ede487203c84fab4f8af696671f0f6568 (patch) | |
tree | a76e66c052e02409aa08a9ea57ccb4d319d2eec7 /libpager/seqnos.c | |
parent | 473aaa2d4d27ee40b00bcb64b8f6f6450a61209e (diff) | |
parent | ac67fbb6e2a503e27a579bdd92bfcd180f377ac4 (diff) |
Merge remote-tracking branch 'darnassus/master'
Diffstat (limited to 'libpager/seqnos.c')
-rw-r--r-- | libpager/seqnos.c | 26 |
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); + } +} |