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

Method threadPushFunction

source/core/StarLua.cpp:513–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

511}
512
513void LuaEngine::threadPushFunction(int threadIndex, int functionIndex) {
514 lua_State* thread = lua_tothread(m_handleThread, threadIndex);
515
516 int status = lua_status(thread);
517 lua_Debug ar;
518 if (status != LUA_OK || lua_getstack(thread, 0, &ar) > 0 || lua_gettop(thread) > 0)
519 throw LuaException(strf("Cannot push function to active or errored thread with status {}", status));
520
521 pushHandle(thread, functionIndex);
522}
523
524LuaThread::Status LuaEngine::threadStatus(int handleIndex) {
525 lua_State* thread = lua_tothread(m_handleThread, handleIndex);

Callers 1

pushFunctionMethod · 0.80

Calls 5

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

Tested by

no test coverage detected