Skip to content

Commit

Permalink
Add #'stop-process
Browse files Browse the repository at this point in the history
Remove #'stop-server
  • Loading branch information
Sven Van Caekenberghe committed Feb 2, 2021
1 parent 9aa23bb commit 7f8de28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/package.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#:current-process
#:kill-process
#:run-process
#:stop-process
#:all-processes
#:start-standard-server
#:open-socket-stream
Expand Down
9 changes: 5 additions & 4 deletions src/sysdeps.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@
;; we must use :default on SBCL to get a bivalent stream
:element-type :default))

(defun stop-server (name)
"Stop a named server"
(defun stop-process (name)
"Stop a named process by destroying it"
(let ((thread (find name (bt:all-threads) :key #'bt:thread-name :test #'equal)))
(when thread (bt:destroy-thread thread))
name))
(when thread
(bt:destroy-thread thread)
name)))

;; working with process locks

Expand Down

0 comments on commit 7f8de28

Please sign in to comment.