diff options
author | Mike Pall <mike> | 2017-04-07 12:27:09 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2017-04-07 12:27:09 +0200 |
commit | f2e2a3f757629c520ebcac44ba7fb12cb07e56e2 (patch) | |
tree | 53477bf4935278c2df459a7368d06c3bb9839729 /src/lj_api.c | |
parent | ef23b70eb64f67c6e6606098baad3cb0ba98d1c3 (diff) | |
download | luajit-f2e2a3f757629c520ebcac44ba7fb12cb07e56e2.tar.gz luajit-f2e2a3f757629c520ebcac44ba7fb12cb07e56e2.tar.bz2 luajit-f2e2a3f757629c520ebcac44ba7fb12cb07e56e2.zip |
From Lua 5.3: Add lua_isyieldable().
Contributed by François Perrad.
Diffstat (limited to 'src/lj_api.c')
-rw-r--r-- | src/lj_api.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lj_api.c b/src/lj_api.c index 3c1a07bc..c417af7e 100644 --- a/src/lj_api.c +++ b/src/lj_api.c | |||
@@ -1113,6 +1113,11 @@ LUALIB_API int luaL_callmeta(lua_State *L, int idx, const char *field) | |||
1113 | 1113 | ||
1114 | /* -- Coroutine yield and resume ------------------------------------------ */ | 1114 | /* -- Coroutine yield and resume ------------------------------------------ */ |
1115 | 1115 | ||
1116 | LUA_API int lua_isyieldable(lua_State *L) | ||
1117 | { | ||
1118 | return cframe_canyield(L->cframe); | ||
1119 | } | ||
1120 | |||
1116 | LUA_API int lua_yield(lua_State *L, int nresults) | 1121 | LUA_API int lua_yield(lua_State *L, int nresults) |
1117 | { | 1122 | { |
1118 | void *cf = L->cframe; | 1123 | void *cf = L->cframe; |