mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-24 05:21:20 -08:00
terminate-process: add information about potential race
This commit is contained in:
parent
6733369ea0
commit
663b1bdcf2
1 changed files with 7 additions and 0 deletions
|
|
@ -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)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue