int lua_yield (lua_State *L, int nresults);
Yields a coroutine.
This function should only be called as the return expression of a C function, as follows:
return lua_yield (L, nresults);
When a C function calls lua_yield
in that way, the running coroutine suspends its execution, and the call to lua_resume
that started this coroutine returns. The parameter nresults
is the number of values from the stack that are passed as results to lua_resume
.