MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / coroutine_create_guard

Function coroutine_create_guard

extlibs/sol3/include/sol/sol.hpp:10047–10061  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10045 }
10046
10047 inline void coroutine_create_guard(lua_State* L) {
10048 if (is_main_thread(L)) {
10049 return;
10050 }
10051 int stacksize = lua_gettop(L);
10052 if (stacksize < 1) {
10053 return;
10054 }
10055 if (type_of(L, 1) != type::function) {
10056 return;
10057 }
10058 // well now we're screwed...
10059 // we can clean the stack and pray it doesn't destroy anything?
10060 lua_pop(L, stacksize);
10061 }
10062
10063 inline void clear(lua_State* L, int table_index) {
10064 lua_pushnil(L);

Callers

nothing calls this directly

Calls 3

is_main_threadFunction · 0.85
lua_gettopFunction · 0.85
type_ofFunction · 0.85

Tested by

no test coverage detected