MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / luaB_close

Function luaB_close

extlibs/lua/src/lcorolib.c:166–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

getcoFunction · 0.85
auxstatusFunction · 0.85
lua_resetthreadFunction · 0.85
lua_pushbooleanFunction · 0.85
lua_xmoveFunction · 0.85
luaL_errorFunction · 0.85

Tested by

no test coverage detected