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:
parent
e355cb07e0
commit
92e91259c3
696
src/core/ev.c
696
src/core/ev.c
File diff suppressed because it is too large
Load Diff
@ -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))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user