From 535e00626b7e93b32d5a99638d784ede66313cf6 Mon Sep 17 00:00:00 2001 From: osch Date: Tue, 21 Aug 2018 20:44:03 +0200 Subject: new method thread:interrupt() --- src/lua/llthreads2/ex.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/lua/llthreads2/ex.lua') diff --git a/src/lua/llthreads2/ex.lua b/src/lua/llthreads2/ex.lua index f0c27d9..b943f5b 100644 --- a/src/lua/llthreads2/ex.lua +++ b/src/lua/llthreads2/ex.lua @@ -141,6 +141,15 @@ function thread_mt:joinable() return self.thread:joinable() end +--- Interrupt thread +-- The thread is interrupted by installing a debug hook that +-- creates an error. +-- @tparam ?boolean if not given, interrupt only once, +-- otherwise this arg sets or unsets permanent interrupt. +function thread_mt:interrupt(arg) + return self.thread:interrupt(arg) +end + end ------------------------------------------------------------------------------- -- cgit v1.2.3-55-g6feb