new function 'lua_isyieldable' (and 'coroutine.isyieldable')
This commit is contained in:
7
ldo.c
7
ldo.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: ldo.c,v 2.114 2014/02/26 15:27:56 roberto Exp roberto $
|
||||
** $Id: ldo.c,v 2.115 2014/03/21 13:52:33 roberto Exp roberto $
|
||||
** Stack and Call structure of Lua
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -571,6 +571,11 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs) {
|
||||
}
|
||||
|
||||
|
||||
LUA_API int lua_isyieldable (lua_State *L) {
|
||||
return (L->nny == 0);
|
||||
}
|
||||
|
||||
|
||||
LUA_API int lua_yieldk (lua_State *L, int nresults, int ctx, lua_CFunction k) {
|
||||
CallInfo *ci = L->ci;
|
||||
luai_userstateyield(L, nresults);
|
||||
|
||||
Reference in New Issue
Block a user