diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-01-30 11:41:39 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-01-30 11:41:39 -0300 |
commit | d1e677c52be3b107a7a29fdc482158f6d9251e79 (patch) | |
tree | 6b201f229a9dc1f0752f6544b71498a4d528941d /lstate.c | |
parent | f7439112a5469078ac4f444106242cf1c1d3fe8a (diff) | |
download | lua-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -320,7 +320,7 @@ void luaE_freethread (lua_State *L, lua_State *L1) { | |||
320 | } | 320 | } |
321 | 321 | ||
322 | 322 | ||
323 | int luaE_resetthread (lua_State *L, int status) { | 323 | TStatus 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 | ||
342 | LUA_API int lua_closethread (lua_State *L, lua_State *from) { | 342 | LUA_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 | ||