From 663b1bdcf2f3751b8a11cb99a317e63bea158d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Mon, 20 Feb 2017 16:20:29 +0100 Subject: [PATCH] terminate-process: add information about potential race --- src/lsp/process.lsp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lsp/process.lsp b/src/lsp/process.lsp index 99c7dfd15..d98bbb130 100644 --- a/src/lsp/process.lsp +++ b/src/lsp/process.lsp @@ -76,6 +76,13 @@ (values (external-process-%status process) (external-process-%code process))) +;;; This function isn't overly safe. Assuming `external-process-wait' +;;; is called after getting PID bu before function sends signal, +;;; zombie may be already removed and we are shooting the +;;; air. Reasonable expectation here would be putting the burden on +;;; the user, that he can't call both functions in racy manner. We are +;;; protected from sigchld-handler here thanks to the global lock +;;; active processes. (defun terminate-process (process &optional force) (with-active-processes-lock (let ((pid (external-process-pid process)))