summaryrefslogtreecommitdiff
path: root/libports/interrupt-on-notify.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-01-05 21:47:19 +0000
committerMiles Bader <miles@gnu.org>1996-01-05 21:47:19 +0000
commit378061c374e3721b6e73d1d92be21c5b7d4ed013 (patch)
tree60088fd00439d0aa044a8b8e0c61e8a00d3c7ae9 /libports/interrupt-on-notify.c
parentb82490a2ad013f83719871923b2a49444b9bdd75 (diff)
(ports_interrupt_rpc_on_notification): If PORT is dead or bogus, interrupt
RPC immediately, and don't add a new request.
Diffstat (limited to 'libports/interrupt-on-notify.c')
-rw-r--r--libports/interrupt-on-notify.c11
1 files changed, 11 insertions, 0 deletions
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;