MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lua_newthread

Function lua_newthread

freebsd/contrib/openzfs/module/lua/lstate.c:235–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

luaB_cocreateFunction · 0.70

Calls 3

luaC_newobjFunction · 0.85
preinit_stateFunction · 0.70
stack_initFunction · 0.70

Tested by

no test coverage detected