diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-01-13 21:14:33 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-01-13 21:14:33 +0000 |
commit | fca89b4dbaf81a07a1599006c93690ea038d0a1f (patch) | |
tree | caa8ff9ac37bff22796f424cb08f80e64f3f30f5 /libpager | |
parent | a14bf060d0f3dbd299df237199a27b18cc518183 (diff) |
Formerly no-senders.c.~2~
Diffstat (limited to 'libpager')
-rw-r--r-- | libpager/no-senders.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libpager/no-senders.c b/libpager/no-senders.c index c75cb7e9..cd5e4fd3 100644 --- a/libpager/no-senders.c +++ b/libpager/no-senders.c @@ -23,6 +23,7 @@ pager_no_senders (struct pager *p, { mach_port_t old; int ret; + int dealloc; mutex_lock (&p->interlock); _pager_wait_for_seqno (p, seqno); @@ -31,10 +32,10 @@ pager_no_senders (struct pager *p, if (mscount > p->mscount) { printf ("pager strange no senders\n"); - done_with_port (p); + dealloc = 1; } else if (mscount == p->mscount) - done_with_port (p); + dealloc = 1; else { /* Request a new notification. The sync value is because we might @@ -46,7 +47,15 @@ pager_no_senders (struct pager *p, MACH_MSG_TYPE_MAKE_SEND_ONCE, &old); if (old) mach_port_deallocate (mach_task_self (), old); + dealloc = 0; } + + mutex_unlock (&p->interlock); + + if (dealloc) + done_with_port (p); + + done_with_port (p); /* for previous check_port_type */ } |