mirror of
https://github.com/janet-lang/janet
synced 2025-11-01 16:13:02 +00:00
Add JANET_ASYNC_EVENT_CANCEL
also fix bug that could cause event loop to hang.
This commit is contained in:
@@ -65,4 +65,13 @@
|
||||
(ev/close writer)
|
||||
(ev/take chan))
|
||||
|
||||
(var result nil)
|
||||
(def fiber
|
||||
(ev/spawn
|
||||
(set result (protect (ev/sleep 0.4)))
|
||||
(assert (= result '(false "boop")) "ev/cancel 1")))
|
||||
(ev/sleep 0.1)
|
||||
(ev/cancel fiber "boop")
|
||||
(ev/sleep 0.1)
|
||||
|
||||
(end-suite)
|
||||
|
||||
Reference in New Issue
Block a user