From fdc25a1ebfe9968dcec390dd556375105aa0be40 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 13 Dec 2018 13:07:53 -0200 Subject: 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...) --- ltests.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index 63d423e0..a38a8926 100644 --- a/ltests.c +++ b/ltests.c @@ -1366,6 +1366,9 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { else if EQ("newthread") { lua_newthread(L1); } + else if EQ("resetthread") { + lua_pushinteger(L1, lua_resetthread(L1)); + } else if EQ("newuserdata") { lua_newuserdata(L1, getnum); } -- cgit v1.2.3-55-g6feb