fix spelling and grammar; clarify use of "os yield" not "sysyield"

machine.lua uses "sysyield" to refer to forced yielding of the entire computer back to scala for execution time limits
main
cinder 3 weeks ago
parent 4a9fbaab30
commit 9813dee130

@ -14,10 +14,10 @@ envBase.kitn = {}
envBase._G, envBase.load = nil
do
--[[propogating os yields
--[[propagating os yields
when a process calls coroutine.yield(), we prepend `false` to the yielded values. os yields start with a truthy value.
in coroutine.resume(), if the coroutine yielded (ie isn't dead) and the first value is truthy (ie an os yield),
we also yield the current coroutine, unwinding the current stack of running coroutines back to the os thread.
we also yield from the current coroutine, unwinding the stack of running coroutines back to the os thread.
when the current coroutine is resumed, we pass the values back into the inner coroutine and repeat.
]]
envBase.coroutine.yield = function(...) return kyield(false, ...) end
@ -30,9 +30,9 @@ do
end
function forwardYield(co, ok, ...)
if co_status(co) ~= 'suspended' then --it's not a sysyield if the coroutine didn't yield (because it returned/errored)
if co_status(co) ~= 'suspended' then --not an os yield if the coroutine didn't yield (because it returned/errored)
return ok, ...
elseif (...) then --firest arg is truthy for os yield, false for coroutine.yield()
elseif (...) then --first arg is truthy for os yield, false for coroutine.yield()
--yield to the scheduler, pass the results (ie signal) back to `co`, then repeat for `co`'s next yield
return forwardYield(co, kresume(co, kyield(...)))
else --`co` called coroutine.yield(), so return its values to the waiting coroutine.resume()

Loading…
Cancel
Save