summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-09-13 18:49:52 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-09-13 18:49:52 +0000
commit5e8522b21c9bafea378c6d2d150a87fb398035db (patch)
treeed148919f77f33fd2b3794054602c7ac6196884d
parent7dac7fa340fc09e2bc615ca97b498493efce7566 (diff)
(_pager_seqnos_memory_object_lock_completed): Don't push the
locks_pending field negative in the case where the pager was terminated before we get called.
-rw-r--r--libpager/lock-completed.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libpager/lock-completed.c b/libpager/lock-completed.c
index 8a02d356..a83badd8 100644
--- a/libpager/lock-completed.c
+++ b/libpager/lock-completed.c
@@ -52,12 +52,16 @@ _pager_seqnos_memory_object_lock_completed (mach_port_t object,
_pager_wait_for_seqno (p, seqno);
for (lr = p->lock_requests; lr; lr = lr->next)
- if (lr->start == offset && lr->end == offset + length
- && !--lr->locks_pending && !lr->pending_writes)
- break;
-
- if (lr)
- condition_broadcast (&p->wakeup);
+ if (lr->start == offset && lr->end == offset + length)
+ {
+ if (lr->locks_pending)
+ {
+ --lr->locks_pending;
+ }
+ if (!lr->locks_pending && !lr->pending_writes)
+ condition_broadcast (&p->wakeup);
+ break;
+ }
_pager_release_seqno (p, seqno);
mutex_unlock (&p->interlock);