aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-01-30 11:41:39 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-01-30 11:41:39 -0300
commitd1e677c52be3b107a7a29fdc482158f6d9251e79 (patch)
tree6b201f229a9dc1f0752f6544b71498a4d528941d /lstate.c
parentf7439112a5469078ac4f444106242cf1c1d3fe8a (diff)
downloadlua-d1e677c52be3b107a7a29fdc482158f6d9251e79.tar.gz
lua-d1e677c52be3b107a7a29fdc482158f6d9251e79.tar.bz2
lua-d1e677c52be3b107a7a29fdc482158f6d9251e79.zip
New type 'TStatus' for thread status/error codes
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lstate.c b/lstate.c
index 0e1cb01e..18ab4900 100644
--- a/lstate.c
+++ b/lstate.c
@@ -320,7 +320,7 @@ void luaE_freethread (lua_State *L, lua_State *L1) {
320} 320}
321 321
322 322
323int luaE_resetthread (lua_State *L, int status) { 323TStatus luaE_resetthread (lua_State *L, TStatus status) {
324 CallInfo *ci = L->ci = &L->base_ci; /* unwind CallInfo list */ 324 CallInfo *ci = L->ci = &L->base_ci; /* unwind CallInfo list */
325 setnilvalue(s2v(L->stack.p)); /* 'function' entry for basic 'ci' */ 325 setnilvalue(s2v(L->stack.p)); /* 'function' entry for basic 'ci' */
326 ci->func.p = L->stack.p; 326 ci->func.p = L->stack.p;
@@ -340,12 +340,12 @@ int luaE_resetthread (lua_State *L, int status) {
340 340
341 341
342LUA_API int lua_closethread (lua_State *L, lua_State *from) { 342LUA_API int lua_closethread (lua_State *L, lua_State *from) {
343 int status; 343 TStatus status;
344 lua_lock(L); 344 lua_lock(L);
345 L->nCcalls = (from) ? getCcalls(from) : 0; 345 L->nCcalls = (from) ? getCcalls(from) : 0;
346 status = luaE_resetthread(L, L->status); 346 status = luaE_resetthread(L, L->status);
347 lua_unlock(L); 347 lua_unlock(L);
348 return status; 348 return APIstatus(status);
349} 349}
350 350
351 351