MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaB_close

Function luaB_close

third-party/lua-5.4.6/src/lcorolib.c:170–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168
169
170static int luaB_close (lua_State *L) {
171 lua_State *co = getco(L);
172 int status = auxstatus(L, co);
173 switch (status) {
174 case COS_DEAD: case COS_YIELD: {
175 status = lua_closethread(co, L);
176 if (status == LUA_OK) {
177 lua_pushboolean(L, 1);
178 return 1;
179 }
180 else {
181 lua_pushboolean(L, 0);
182 lua_xmove(co, L, 1); /* move error message */
183 return 2;
184 }
185 }
186 default: /* normal or running coroutine */
187 return luaL_error(L, "cannot close a %s coroutine", statname[status]);
188 }
189}
190
191
192static const luaL_Reg co_funcs[] = {

Callers

nothing calls this directly

Calls 6

getcoFunction · 0.70
auxstatusFunction · 0.70
lua_closethreadFunction · 0.70
lua_pushbooleanFunction · 0.70
lua_xmoveFunction · 0.70
luaL_errorFunction · 0.70

Tested by

no test coverage detected