summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libports/ChangeLog8
-rw-r--r--libports/inhibit-all-rpcs.c15
-rw-r--r--libports/inhibit-bucket-rpcs.c12
-rw-r--r--libports/inhibit-class-rpcs.c11
-rw-r--r--libports/inhibit-port-rpcs.c11
5 files changed, 43 insertions, 14 deletions
diff --git a/libports/ChangeLog b/libports/ChangeLog
index 4ac61f9a..b226924d 100644
--- a/libports/ChangeLog
+++ b/libports/ChangeLog
@@ -1,3 +1,11 @@
+2000-07-25 Mark Kettenis <kettenis@gnu.org>
+
+ * inhibit-all-rpcs.c (ports_inhibit_all_rpcs): Avoid calling
+ hurd_thread_cancel on the current thread.
+ * inhibit-class-rpcs.c (ports_inhibit_class_rpcs): Likewise.
+ * inhibit-bucket-rpcs.c (ports_inhibit_bucket_rpcs): Likewise.
+ * inhibit-port-rpcs.c (ports_inhibit_port_rpcs): Likewise.
+
2000-03-17 Roland McGrath <roland@baalperazim.frob.com>
* get-send-right.c: New file.
diff --git a/libports/inhibit-all-rpcs.c b/libports/inhibit-all-rpcs.c
index 13aa62c6..9efb3c2f 100644
--- a/libports/inhibit-all-rpcs.c
+++ b/libports/inhibit-all-rpcs.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc.
Written by Michael I. Bushnell.
This file is part of the GNU Hurd.
@@ -42,8 +42,15 @@ ports_inhibit_all_rpcs ()
struct port_info *pi = portstruct;
for (rpc = pi->current_rpcs; rpc; rpc = rpc->next)
- if (hurd_thread_cancel (rpc->thread) == EINTR)
- this_one = 1;
+ {
+ /* Avoid cancelling the calling thread if it's currently
+ handling a RPC. */
+ if (rpc->thread == hurd_thread_self ())
+ this_one = 1;
+ else
+ hurd_thread_cancel (rpc->thread);
+ }
+
return 0;
}
@@ -70,5 +77,3 @@ ports_inhibit_all_rpcs ()
return err;
}
-
-
diff --git a/libports/inhibit-bucket-rpcs.c b/libports/inhibit-bucket-rpcs.c
index a04906ff..06af9c60 100644
--- a/libports/inhibit-bucket-rpcs.c
+++ b/libports/inhibit-bucket-rpcs.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc.
Written by Michael I. Bushnell.
This file is part of the GNU Hurd.
@@ -41,8 +41,14 @@ ports_inhibit_bucket_rpcs (struct port_bucket *bucket)
struct port_info *pi = portstruct;
for (rpc = pi->current_rpcs; rpc; rpc = rpc->next)
- if (hurd_thread_cancel (rpc->thread) == EINTR)
- this_one = 1;
+ {
+ /* Avoid cancelling the calling thread. */
+ if (rpc->thread == hurd_thread_self ())
+ this_one = 1;
+ else
+ hurd_thread_cancel (rpc->thread);
+ }
+
return 0;
}
diff --git a/libports/inhibit-class-rpcs.c b/libports/inhibit-class-rpcs.c
index 00b9b361..951de4bf 100644
--- a/libports/inhibit-class-rpcs.c
+++ b/libports/inhibit-class-rpcs.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc.
Written by Michael I. Bushnell.
This file is part of the GNU Hurd.
@@ -39,8 +39,13 @@ ports_inhibit_class_rpcs (struct port_class *class)
for (pi = class->ports; pi; pi = pi->next)
for (rpc = pi->current_rpcs; rpc; rpc = rpc->next)
- if (hurd_thread_cancel (rpc->thread) == EINTR)
- this_one = 1;
+ {
+ /* Avoid cancelling the calling thread. */
+ if (rpc->thread == hurd_thread_self ())
+ this_one = 1;
+ else
+ hurd_thread_cancel (rpc->thread);
+ }
while (class->rpcs > this_one)
{
diff --git a/libports/inhibit-port-rpcs.c b/libports/inhibit-port-rpcs.c
index 4ec5d853..02a3b462 100644
--- a/libports/inhibit-port-rpcs.c
+++ b/libports/inhibit-port-rpcs.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc.
Written by Michael I. Bushnell.
This file is part of the GNU Hurd.
@@ -38,8 +38,13 @@ ports_inhibit_port_rpcs (void *portstruct)
struct rpc_info *this_rpc = 0;
for (rpc = pi->current_rpcs; rpc; rpc = rpc->next)
- if (hurd_thread_cancel (rpc->thread) == EINTR)
- this_rpc = rpc;
+ {
+ /* Avoid cancelling the calling thread. */
+ if (rpc->thread == hurd_thread_self ())
+ this_rpc = rpc;
+ else
+ hurd_thread_cancel (rpc->thread);
+ }
while (pi->current_rpcs
/* If this thread's RPC is the only one left, it doesn't count. */