1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 19:19:53 +00:00

Allow yielding from root fiber to ev loop.

This commit is contained in:
Calvin Rose 2021-01-09 23:35:34 -06:00
parent 8286b33c52
commit 7ae7984f3c

View File

@ -520,7 +520,7 @@ static void run_one(JanetFiber *fiber, Janet value, JanetSignal sigin) {
fiber->flags &= ~JANET_FIBER_FLAG_SCHEDULED; fiber->flags &= ~JANET_FIBER_FLAG_SCHEDULED;
Janet res; Janet res;
JanetSignal sig = janet_continue_signal(fiber, value, &res, sigin); JanetSignal sig = janet_continue_signal(fiber, value, &res, sigin);
if (sig != JANET_SIGNAL_EVENT) { if (sig != JANET_SIGNAL_EVENT && sig != JANET_SIGNAL_YIELD) {
if (fiber->done_channel) { if (fiber->done_channel) {
JanetChannel *chan = (JanetChannel *)(fiber->done_channel); JanetChannel *chan = (JanetChannel *)(fiber->done_channel);
janet_channel_push(chan, janet_wrap_fiber(fiber), 2); janet_channel_push(chan, janet_wrap_fiber(fiber), 2);