| 522 | } |
| 523 | |
| 524 | LuaThread::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 | |
| 538 | LuaContext LuaEngine::createContext() { |
| 539 | lua_checkstack(m_state, 2); |
no test coverage detected