diff options
author | Miles Bader <miles@gnu.org> | 1996-02-21 00:28:06 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-02-21 00:28:06 +0000 |
commit | a095bd1c020058adfbddb1606d368830268c545d (patch) | |
tree | 0bd79a98bffe2b7e60a9b54fbd3934c4808ecc2a /libpager | |
parent | 4d410d3af77e2b557fa2a04de65a9d5d1fe93c2b (diff) |
(_pager_seqnos_memory_object_terminate):
Always wait for and release SEQNO if OBJECT is a valid pager.
Diffstat (limited to 'libpager')
-rw-r--r-- | libpager/object-terminate.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libpager/object-terminate.c b/libpager/object-terminate.c index 205dd189..8598ab50 100644 --- a/libpager/object-terminate.c +++ b/libpager/object-terminate.c @@ -1,5 +1,5 @@ /* Implementation of memory_object_terminate for pager library - Copyright (C) 1994, 1995 Free Software Foundation + Copyright (C) 1994, 1995, 1996 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 @@ -32,6 +32,9 @@ _pager_seqnos_memory_object_terminate (mach_port_t object, p = ports_lookup_port (0, object, _pager_class); if (!p) return EOPNOTSUPP; + + mutex_lock (&p->interlock); + _pager_wait_for_seqno (p, seqno); if (control != p->memobjcntl) { @@ -44,10 +47,6 @@ _pager_seqnos_memory_object_terminate (mach_port_t object, goto out; } - mutex_lock (&p->interlock); - - _pager_wait_for_seqno (p, seqno); - while (p->noterm) { p->termwaiting = 1; @@ -71,11 +70,11 @@ _pager_seqnos_memory_object_terminate (mach_port_t object, } #endif + out: _pager_release_seqno (p, seqno); mutex_unlock (&p->interlock); - - out: ports_port_deref (p); + return 0; } |