Skip to content

Commit

Permalink
Join worker threads in END-KERNEL
Browse files Browse the repository at this point in the history
  • Loading branch information
sionescu committed Mar 10, 2024
1 parent 6950400 commit 0e80147
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/kernel/core.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,17 @@ deadlocked or infinite looping tasks."
(when (alivep kernel)
(let ((channel (let ((*kernel* kernel)) (make-channel)))
(threads (map 'list #'thread (workers kernel))))
(cond (wait
(shutdown channel kernel)
threads)
(t
(cons (with-thread (:name "lparallel kernel shutdown manager")
(shutdown channel kernel))
threads))))))))
(flet ((shutdown-kernel-and-threads ()
(shutdown channel kernel)
(alexandria:ignore-some-conditions (bt2:abnormal-exit)
(map nil #'bt2:join-thread threads))))
(cond (wait
(shutdown-kernel-and-threads)
threads)
(t
(cons (with-thread (:name "lparallel kernel shutdown manager")
(shutdown-kernel-and-threads))
threads)))))))))

(defun task-categories-running ()
"Return a vector containing the task category currently running for
Expand Down

0 comments on commit 0e80147

Please sign in to comment.