From d3f649ba551ed42b319f11d3207dd5ad1703ca0c Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 18 Nov 1995 14:54:01 +0000 Subject: If calling thread is serving an RPC, don't block waiting for that RPC to finish. --- libports/inhibit-all-rpcs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libports/inhibit-all-rpcs.c') 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); -- cgit v1.2.3