MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / luaE_resetthread

Function luaE_resetthread

lib/lua/src/lstate.c:323–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321
322
323int luaE_resetthread (lua_State *L, int status) {
324 CallInfo *ci = L->ci = &L->base_ci; /* unwind CallInfo list */
325 setnilvalue(s2v(L->stack.p)); /* 'function' entry for basic 'ci' */
326 ci->func.p = L->stack.p;
327 ci->callstatus = CIST_C;
328 if (status == LUA_YIELD)
329 status = LUA_OK;
330 L->status = LUA_OK; /* so it can run __close metamethods */
331 status = luaD_closeprotected(L, 1, status);
332 if (status != LUA_OK) /* errors? */
333 luaD_seterrorobj(L, status, L->stack.p + 1);
334 else
335 L->top.p = L->stack.p + 1;
336 ci->top.p = L->top.p + LUA_MINSTACK;
337 luaD_reallocstack(L, cast_int(ci->top.p - L->stack.p), 0);
338 return status;
339}
340
341
342LUA_API int lua_closethread (lua_State *L, lua_State *from) {

Callers 2

lua_closethreadFunction · 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