MCPcopy Create free account
hub / github.com/DFHack/dfhack / NewCoroutine

Method NewCoroutine

library/LuaTools.cpp:965–972  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

963}
964
965lua_State *DFHack::Lua::NewCoroutine(lua_State *L) {
966 if (Lua::IsCoreContext(L) && getenv("DFHACK_ENABLE_LUACOV"))
967 add_luacov_coroutine_wrapper(L);
968 lua_State *NL = lua_newthread(L);
969 lua_swap(L);
970 lua_xmove(L, NL, 1); /* move function from L to NL */
971 return NL;
972}
973
974int DFHack::Lua::SafeResume(color_ostream &out, lua_State *from, lua_State *thread, int nargs, int nres, bool perr)
975{

Callers

nothing calls this directly

Calls 4

lua_newthreadFunction · 0.85
lua_swapFunction · 0.85
lua_xmoveFunction · 0.85

Tested by

no test coverage detected