emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] externals/sly 00cbab0 01/47: Slynk: avoid race conditions when


From: ELPA Syncer
Subject: [nongnu] externals/sly 00cbab0 01/47: Slynk: avoid race conditions when killing threads
Date: Thu, 17 Dec 2020 18:57:12 -0500 (EST)

branch: externals/sly
commit 00cbab08c3d8d2ba7f27f3176b7fd2790c61b028
Author: Marius Gerbershagen <marius.gerbershagen@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Slynk: avoid race conditions when killing threads
    
    Threads may die after we check whether they are alive, but before we
    execute kill-thread. This can lead to spurious errors, e.g. on slime
    startup.
    
    * slynk/slynk.lisp (sentinel-stop-server)
    (cleanup-connection-threads): Use ignore-errors.
    
    Co-authored-by: João Távora <joaotavora@gmail.com>
    Cherry-picked-from: SLIME commit 1ea0e6ae54a07b1046e4c4c9e674acf0e855e0e2
---
 slynk/slynk.lisp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/slynk/slynk.lisp b/slynk/slynk.lisp
index c6fb5b0..f89f7f1 100644
--- a/slynk/slynk.lisp
+++ b/slynk/slynk.lisp
@@ -775,7 +775,7 @@ recently established one."
              (when (and thread
                         (thread-alive-p thread)
                         (not (eq thread (current-thread))))
-               (kill-thread thread))))
+               (ignore-errors (kill-thread thread)))))
           (t
            (warn "No server for ~s: ~s" key value)))))
 
@@ -1452,7 +1452,7 @@ event was found."
       (when (and thread
                  (thread-alive-p thread)
                  (not (equal (current-thread) thread)))
-        (kill-thread thread)))))
+        (ignore-errors (kill-thread thread))))))
 
 ;;;;;; Signal driven IO
 



reply via email to

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