commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 21/21: Avoid ports_interrupt_rpcs cancel itself


From: Samuel Thibault
Subject: [hurd] 21/21: Avoid ports_interrupt_rpcs cancel itself
Date: Sat, 04 Mar 2017 21:10:59 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit db7dd39b84be0371536c9ccec907cd918476c0ea
Author: Samuel Thibault <address@hidden>
Date:   Sat Mar 4 20:11:47 2017 +0100

    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.
---
 libports/interrupt-rpcs.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libports/interrupt-rpcs.c b/libports/interrupt-rpcs.c
index 42f51a5..7017548 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);

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]