1
0
mirror of https://github.com/janet-lang/janet synced 2025-07-03 10:32:53 +00:00

Don't call pthread cancel on normal exits.

Calling pthread_cancel on threads that can exit normally is not needed.
Instead, we immediately call pthread_join if a thread can exit normally.
This commit is contained in:
Calvin Rose 2025-05-18 09:50:27 -05:00
parent e355cb07e0
commit 92e91259c3
2 changed files with 2635 additions and 2631 deletions

File diff suppressed because it is too large Load Diff

View File

@ -564,12 +564,14 @@
(,ev/deadline ,sec nil ,f true) (,ev/deadline ,sec nil ,f true)
(,resume ,f)))) (,resume ,f))))
(repeat 10 (for i 0 10
# (print "iteration " i)
(assert (= :done (with-deadline2 10 (assert (= :done (with-deadline2 10
(ev/sleep 0.01) (ev/sleep 0.01)
:done)) "deadline with interrupt exits normally")) :done)) "deadline with interrupt exits normally"))
(repeat 10 (for i 0 10
# (print "iteration " i)
(let [f (coro (forever :foo))] (let [f (coro (forever :foo))]
(ev/deadline 0.01 nil f true) (ev/deadline 0.01 nil f true)
(assert-error "deadline expired" (resume f)))) (assert-error "deadline expired" (resume f))))