1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-07 19:13:02 +00:00

Fix threaded supervisor channels - Fix #766

Some pointer casting with abstract types was incorrect, resulting
in strange behavior when trying to use supervisor channels that were
threaded. This fix also adds the ability to supply a supervisor channel
directly when creating a thread.
This commit is contained in:
Calvin Rose
2021-08-16 21:14:06 -05:00
parent 87b8dffe23
commit e552757edc
4 changed files with 66 additions and 24 deletions

View File

@@ -3370,9 +3370,9 @@
~(,ev/thread (fiber/new (fn _thread [&] ,;body) :t)))
(defmacro ev/spawn-thread
``Run some code in a new thread. Returns a fiber that can be ``
``Run some code in a new thread. Like `ev/do-thread`, but returns immediately with a fiber.``
[& body]
~(,ev/thread (fiber/new (fn _thread [&] ,;body) :t) :n))
~(,ev/thread (fiber/new (fn _thread [&] ,;body) :t) nil :n))
(defmacro ev/with-deadline
`Run a body of code with a deadline, such that if the code does not complete before