MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / threadStatus

Method threadStatus

source/core/StarLua.cpp:524–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

522}
523
524LuaThread::Status LuaEngine::threadStatus(int handleIndex) {
525 lua_State* thread = lua_tothread(m_handleThread, handleIndex);
526
527 int status = lua_status(thread);
528 if (status != LUA_OK && status != LUA_YIELD)
529 return LuaThread::Status::Error;
530
531 lua_Debug ar;
532 if (status == LUA_YIELD || lua_getstack(thread, 0, &ar) > 0 || lua_gettop(thread) > 0)
533 return LuaThread::Status::Active;
534
535 return LuaThread::Status::Dead;
536}
537
538LuaContext LuaEngine::createContext() {
539 lua_checkstack(m_state, 2);

Callers 1

statusMethod · 0.80

Calls 4

lua_tothreadFunction · 0.85
lua_statusFunction · 0.85
lua_getstackFunction · 0.85
lua_gettopFunction · 0.85

Tested by

no test coverage detected