MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / costatus

Function costatus

Source/Misc/lua/src/lua.c:11354–11371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11352{"running", "suspended", "normal", "dead"};
11353
11354static int costatus (lua_State *L, lua_State *co) {
11355if (L == co) return CO_RUN;
11356switch (lua_status(co)) {
11357case LUA_YIELD:
11358return CO_SUS;
11359case 0: {
11360lua_Debug ar;
11361if (lua_getstack(co, 0, &ar) > 0) /* does it have frames? */
11362return CO_NOR; /* it is running */
11363else if (lua_gettop(co) == 0)
11364return CO_DEAD;
11365else
11366return CO_SUS; /* initial state */
11367}
11368default: /* some error occured */
11369return CO_DEAD;
11370}
11371}
11372
11373
11374static int luaB_costatus (lua_State *L) {

Callers 2

luaB_costatusFunction · 0.85
auxresumeFunction · 0.85

Calls 3

lua_statusFunction · 0.85
lua_getstackFunction · 0.85
lua_gettopFunction · 0.85

Tested by

no test coverage detected