mirror of
https://github.com/janet-lang/janet
synced 2025-07-03 02:22:52 +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
5248
src/core/ev.c
5248
src/core/ev.c
File diff suppressed because it is too large
Load Diff
@ -564,15 +564,17 @@
|
||||
(,ev/deadline ,sec nil ,f true)
|
||||
(,resume ,f))))
|
||||
|
||||
(repeat 10
|
||||
(assert (= :done (with-deadline2 10
|
||||
(ev/sleep 0.01)
|
||||
:done)) "deadline with interrupt exits normally"))
|
||||
(for i 0 10
|
||||
# (print "iteration " i)
|
||||
(assert (= :done (with-deadline2 10
|
||||
(ev/sleep 0.01)
|
||||
:done)) "deadline with interrupt exits normally"))
|
||||
|
||||
(repeat 10
|
||||
(let [f (coro (forever :foo))]
|
||||
(ev/deadline 0.01 nil f true)
|
||||
(assert-error "deadline expired" (resume f))))
|
||||
(for i 0 10
|
||||
# (print "iteration " i)
|
||||
(let [f (coro (forever :foo))]
|
||||
(ev/deadline 0.01 nil f true)
|
||||
(assert-error "deadline expired" (resume f))))
|
||||
|
||||
# Use :err :stdout
|
||||
(def- subproc-code '(do (eprint "hi") (eflush) (print "there") (flush)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user