summaryrefslogtreecommitdiff
path: root/libpager/object-terminate.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpager/object-terminate.c')
-rw-r--r--libpager/object-terminate.c13
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;
}