aboutsummaryrefslogtreecommitdiff
path: root/libports
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2017-03-04 20:11:47 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2017-03-04 20:11:47 +0100
commitdb7dd39b84be0371536c9ccec907cd918476c0ea (patch)
tree34aea1ac0cada434505bc09f2bc5df2e3f1b70bd /libports
parentcfcb0edb14772b625c7d744c4f2e455c53c92d6b (diff)
downloadhurd-db7dd39b84be0371536c9ccec907cd918476c0ea.tar.gz
hurd-db7dd39b84be0371536c9ccec907cd918476c0ea.tar.bz2
hurd-db7dd39b84be0371536c9ccec907cd918476c0ea.zip
Avoid ports_interrupt_rpcs cancel itself
While this does not hurt immediately, callers of ports_interrupt_rpcs would themselves get canceled at the next cancelation point. * libports/interrupt-rpcs.c (ports_interrupt_rpcs): Do not call cancel ourself.
Diffstat (limited to 'libports')
-rw-r--r--libports/interrupt-rpcs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libports/interrupt-rpcs.c b/libports/interrupt-rpcs.c
index 42f51a5e..70175480 100644
--- a/libports/interrupt-rpcs.c
+++ b/libports/interrupt-rpcs.c
@@ -26,13 +26,17 @@ ports_interrupt_rpcs (void *portstruct)
{
struct port_info *pi = portstruct;
struct rpc_info *rpc;
+ thread_t self = hurd_thread_self ();
pthread_mutex_lock (&_ports_lock);
for (rpc = pi->current_rpcs; rpc; rpc = rpc->next)
{
- hurd_thread_cancel (rpc->thread);
- _ports_record_interruption (rpc);
+ if (rpc->thread != self)
+ {
+ hurd_thread_cancel (rpc->thread);
+ _ports_record_interruption (rpc);
+ }
}
pthread_mutex_unlock (&_ports_lock);