aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-05-08 10:52:20 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-05-08 10:52:20 -0300
commit1bd70a8e40a8600658c706d5f171138e9b902aba (patch)
tree9b4408457bbd03a3fda83b21bbf54dba56234d08 /ldo.c
parentef83457427cdb2d9f29d94177131db8e6e2eb606 (diff)
downloadlua-1bd70a8e40a8600658c706d5f171138e9b902aba.tar.gz
lua-1bd70a8e40a8600658c706d5f171138e9b902aba.tar.bz2
lua-1bd70a8e40a8600658c706d5f171138e9b902aba.zip
new function 'lua_isyieldable' (and 'coroutine.isyieldable')
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ldo.c b/ldo.c
index 267c8237..ae58cda7 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 2.114 2014/02/26 15:27:56 roberto Exp roberto $ 2** $Id: ldo.c,v 2.115 2014/03/21 13:52:33 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -571,6 +571,11 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs) {
571} 571}
572 572
573 573
574LUA_API int lua_isyieldable (lua_State *L) {
575 return (L->nny == 0);
576}
577
578
574LUA_API int lua_yieldk (lua_State *L, int nresults, int ctx, lua_CFunction k) { 579LUA_API int lua_yieldk (lua_State *L, int nresults, int ctx, lua_CFunction k) {
575 CallInfo *ci = L->ci; 580 CallInfo *ci = L->ci;
576 luai_userstateyield(L, nresults); 581 luai_userstateyield(L, nresults);