summaryrefslogtreecommitdiff
path: root/libports/inhibit-class-rpcs.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-11-18 14:54:01 +0000
committerRoland McGrath <roland@gnu.org>1995-11-18 14:54:01 +0000
commitd3f649ba551ed42b319f11d3207dd5ad1703ca0c (patch)
tree28dfcad91b83370220a878ad588d1296cf1644c4 /libports/inhibit-class-rpcs.c
parent5636382647c32d771308aaf8d5045d29da6844f3 (diff)
If calling thread is serving an RPC, don't block waiting for that RPC to
finish.
Diffstat (limited to 'libports/inhibit-class-rpcs.c')
-rw-r--r--libports/inhibit-class-rpcs.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/libports/inhibit-class-rpcs.c b/libports/inhibit-class-rpcs.c
index 033d0b11..5b5a602b 100644
--- a/libports/inhibit-class-rpcs.c
+++ b/libports/inhibit-class-rpcs.c
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (C) 1995 Free Software Foundation, Inc.
Written by Michael I. Bushnell.
@@ -27,23 +27,26 @@ ports_inhibit_class_rpcs (struct port_class *class)
{
struct port_info *pi;
struct rpc_info *rpc;
-
+ int this_one;
+
mutex_lock (&_ports_lock);
-
+
+ this_one = 0;
for (pi = class->ports; pi; pi = pi->next)
for (rpc = pi->current_rpcs; rpc; rpc = rpc->next)
- hurd_thread_cancel (rpc->thread);
+ if (hurd_thread_cancel (rpc->thread) == EINTR)
+ this_one = 1;
- while (class->rpcs)
+ while (class->rpcs > this_one)
{
class->flags |= PORT_CLASS_INHIBIT_WAIT;
condition_wait (&_ports_block, &_ports_lock);
}
-
+
class->flags |= PORT_CLASS_INHIBITED;
class->flags &= ~PORT_CLASS_INHIBIT_WAIT;
mutex_unlock (&_ports_lock);
}
-
+