MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / luaE_resetthread

Function luaE_resetthread

3rd/lua-5.4.3/src/lstate.c:326–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324
325
326int luaE_resetthread (lua_State *L, int status) {
327 CallInfo *ci = L->ci = &L->base_ci; /* unwind CallInfo list */
328 setnilvalue(s2v(L->stack)); /* 'function' entry for basic 'ci' */
329 ci->func = L->stack;
330 ci->callstatus = CIST_C;
331 if (status == LUA_YIELD)
332 status = LUA_OK;
333 status = luaD_closeprotected(L, 1, status);
334 if (status != LUA_OK) /* errors? */
335 luaD_seterrorobj(L, status, L->stack + 1);
336 else
337 L->top = L->stack + 1;
338 ci->top = L->top + LUA_MINSTACK;
339 L->status = cast_byte(status);
340 luaD_reallocstack(L, cast_int(ci->top - L->stack), 0);
341 return status;
342}
343
344
345LUA_API int lua_resetthread (lua_State *L) {

Callers 2

lua_resetthreadFunction · 0.85
luaD_throwFunction · 0.85

Calls 3

luaD_closeprotectedFunction · 0.85
luaD_seterrorobjFunction · 0.85
luaD_reallocstackFunction · 0.85

Tested by

no test coverage detected