MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / lua_newthread

Function lua_newthread

third-party/lua-5.2.4/src/lstate.c:237–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235
236
237LUA_API lua_State *lua_newthread (lua_State *L) {
238 lua_State *L1;
239 lua_lock(L);
240 luaC_checkGC(L);
241 L1 = &luaC_newobj(L, LUA_TTHREAD, sizeof(LX), NULL, offsetof(LX, l))->th;
242 setthvalue(L, L->top, L1);
243 api_incr_top(L);
244 preinit_state(L1, G(L));
245 L1->hookmask = L->hookmask;
246 L1->basehookcount = L->basehookcount;
247 L1->hook = L->hook;
248 resethookcount(L1);
249 luai_userstatethread(L, L1);
250 stack_init(L1, L); /* init stack */
251 lua_unlock(L);
252 return L1;
253}
254
255
256void luaE_freethread (lua_State *L, lua_State *L1) {

Callers 1

luaB_cocreateFunction · 0.70

Calls 3

luaC_newobjFunction · 0.70
preinit_stateFunction · 0.70
stack_initFunction · 0.70

Tested by

no test coverage detected