From 378061c374e3721b6e73d1d92be21c5b7d4ed013 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 5 Jan 1996 21:47:19 +0000 Subject: (ports_interrupt_rpc_on_notification): If PORT is dead or bogus, interrupt RPC immediately, and don't add a new request. --- libports/interrupt-on-notify.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libports/interrupt-on-notify.c b/libports/interrupt-on-notify.c index f66a67ab..62f67768 100644 --- a/libports/interrupt-on-notify.c +++ b/libports/interrupt-on-notify.c @@ -35,8 +35,17 @@ ports_interrupt_rpc_on_notification (void *object, mutex_lock (&_ports_lock); + if (! MACH_PORT_VALID (port)) + /* PORT is already dead or bogus, so interrupt the rpc immediately. */ + { + hurd_thread_cancel (rpc->thread); + mutex_unlock (&_ports_lock); + return 0; + } + new_req = _ports_free_rpc_notifies; if (new_req) + /* We got a req off the free list. */ _ports_free_rpc_notifies = new_req->next; else /* No free notify structs, allocate one; it's expected that 99% of the @@ -92,11 +101,13 @@ ports_interrupt_rpc_on_notification (void *object, break; if (req) + /* REQ is already pending for PORT/WHAT on RPC, so free NEW_REQ. */ { new_req->next = _ports_free_rpc_notifies; _ports_free_rpc_notifies = new_req; } else + /* Add a new request for PORT/WHAT on RPC. */ { req = new_req; -- cgit v1.2.3