Overhaul of thread handling to support blocking functions other than wait
This commit is contained in:
@@ -591,6 +591,9 @@ LUA_API int lua_yieldk (lua_State *L, int nresults, int ctx, lua_CFunction k) {
|
||||
return 0; /* return to 'luaD_hook' */
|
||||
}
|
||||
|
||||
LUA_API int lua_isyieldable (lua_State *L) {
|
||||
return (L->nny == 0);
|
||||
}
|
||||
|
||||
int luaD_pcall (lua_State *L, Pfunc func, void *u,
|
||||
ptrdiff_t old_top, ptrdiff_t ef) {
|
||||
|
||||
@@ -277,6 +277,7 @@ LUA_API int (lua_yieldk) (lua_State *L, int nresults, int ctx,
|
||||
#define lua_yield(L,n) lua_yieldk(L, (n), 0, NULL)
|
||||
LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg);
|
||||
LUA_API int (lua_status) (lua_State *L);
|
||||
LUA_API int (lua_isyieldable) (lua_State *L);
|
||||
|
||||
/*
|
||||
** garbage-collection function and options
|
||||
|
||||
Reference in New Issue
Block a user