diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-12-13 13:07:53 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-12-13 13:07:53 -0200 |
commit | fdc25a1ebfe9968dcec390dd556375105aa0be40 (patch) | |
tree | 43759131636a501ec92475d453fd1a1c73bc8090 /ltests.c | |
parent | 3b06f983ae0e57b90cdeb500c84bb524e5c3635b (diff) | |
download | lua-fdc25a1ebfe9968dcec390dd556375105aa0be40.tar.gz lua-fdc25a1ebfe9968dcec390dd556375105aa0be40.tar.bz2 lua-fdc25a1ebfe9968dcec390dd556375105aa0be40.zip |
New functions 'lua_resetthread' and 'coroutine.kill'
New functions to reset/kill a thread/coroutine, mainly (only?) to
close any pending to-be-closed variable. ('lua_resetthread' also
allows a thread to be reused...)
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1366,6 +1366,9 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { | |||
1366 | else if EQ("newthread") { | 1366 | else if EQ("newthread") { |
1367 | lua_newthread(L1); | 1367 | lua_newthread(L1); |
1368 | } | 1368 | } |
1369 | else if EQ("resetthread") { | ||
1370 | lua_pushinteger(L1, lua_resetthread(L1)); | ||
1371 | } | ||
1369 | else if EQ("newuserdata") { | 1372 | else if EQ("newuserdata") { |
1370 | lua_newuserdata(L1, getnum); | 1373 | lua_newuserdata(L1, getnum); |
1371 | } | 1374 | } |