summaryrefslogtreecommitdiff
path: root/libports/inhibit-all-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-all-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-all-rpcs.c')
-rw-r--r--libports/inhibit-all-rpcs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libports/inhibit-all-rpcs.c b/libports/inhibit-all-rpcs.c
index ebddbddd..55076486 100644
--- a/libports/inhibit-all-rpcs.c
+++ b/libports/inhibit-all-rpcs.c
@@ -27,13 +27,15 @@ void
ports_inhibit_all_rpcs ()
{
struct port_bucket *bucket;
+ int this_one = 0;
error_t interruptor (void *portstruct)
{
struct port_info *pi = portstruct;
struct rpc_info *rpc;
for (rpc = pi->current_rpcs; rpc; rpc = rpc->next)
- hurd_thread_cancel (rpc->thread);
+ if (hurd_thread_cancel (rpc->thread) == EINTR)
+ this_one = 1;
return 0;
}
@@ -42,7 +44,7 @@ ports_inhibit_all_rpcs ()
for (bucket = _ports_all_buckets; bucket; bucket = bucket->next)
ihash_iterate (bucket->htable, interruptor);
- while (_ports_total_rpcs)
+ while (_ports_total_rpcs > this_one)
{
_ports_flags |= _PORTS_INHIBIT_WAIT;
condition_wait (&_ports_block, &_ports_lock);