I have a question about lua_yield
below is the actually listing of lua_yield 5..
/* ldo.c,v 2.37 2005/12/22 16:19:56 */
LUA_API int lua_yield (lua_State *L, int nresults) {
luai_userstateyield(L, nresults);
lua_lock(L);
if (L->nCcalls > 0)
luaG_runerror(L, "attempt to yield across metamethod/C-call boundary");
L->base = L->top - nresults; /* protect stack slots below */
L->status = LUA_YIELD;
lua_unlock(L);
return -1;
}
Why lua_yield return error in C-call boundary?
practically lua_yield is called in C because lua_yield is C-API.
I try to use it for Sleep like function through registering CFunction to Lua-VM.