From Lua 5.3: Add lua_isyieldable().

Contributed by François Perrad.
This commit is contained in:
Mike Pall
2017-04-07 12:27:09 +02:00
parent ef23b70eb6
commit f2e2a3f757
2 changed files with 8 additions and 0 deletions

View File

@@ -1113,6 +1113,11 @@ LUALIB_API int luaL_callmeta(lua_State *L, int idx, const char *field)
/* -- Coroutine yield and resume ------------------------------------------ */
LUA_API int lua_isyieldable(lua_State *L)
{
return cframe_canyield(L->cframe);
}
LUA_API int lua_yield(lua_State *L, int nresults)
{
void *cf = L->cframe;