| 352 | |
| 353 | |
| 354 | int lua_resetthread (lua_State *L) { |
| 355 | CallInfo *ci; |
| 356 | int status; |
| 357 | lua_lock(L); |
| 358 | ci = &L->base_ci; |
| 359 | status = luaF_close(L, L->stack, CLOSEPROTECT); |
| 360 | setnilvalue(s2v(L->stack)); /* 'function' entry for basic 'ci' */ |
| 361 | if (status != CLOSEPROTECT) /* real errors? */ |
| 362 | luaD_seterrorobj(L, status, L->stack + 1); |
| 363 | else { |
| 364 | status = LUA_OK; |
| 365 | L->top = L->stack + 1; |
| 366 | } |
| 367 | ci->callstatus = CIST_C; |
| 368 | ci->func = L->stack; |
| 369 | ci->top = L->top + LUA_MINSTACK; |
| 370 | L->ci = ci; |
| 371 | L->status = status; |
| 372 | lua_unlock(L); |
| 373 | return status; |
| 374 | } |
| 375 | |
| 376 | |
| 377 | LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { |
no test coverage detected