diff options
| author | osch <oliver at luced de> | 2018-08-21 20:44:03 +0200 |
|---|---|---|
| committer | osch <oliver at luced de> | 2018-08-21 20:46:45 +0200 |
| commit | 535e00626b7e93b32d5a99638d784ede66313cf6 (patch) | |
| tree | c801d12d27117ca1fee9295df33b5b05a21cd5ee /src/lua | |
| parent | e33999a890c8bfdb0c1f753820e4261dabb67faa (diff) | |
| download | lua-llthreads2-535e00626b7e93b32d5a99638d784ede66313cf6.tar.gz lua-llthreads2-535e00626b7e93b32d5a99638d784ede66313cf6.tar.bz2 lua-llthreads2-535e00626b7e93b32d5a99638d784ede66313cf6.zip | |
new method thread:interrupt()
Diffstat (limited to 'src/lua')
| -rw-r--r-- | src/lua/llthreads2/ex.lua | 9 |
1 files changed, 9 insertions, 0 deletions
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() | |||
| 141 | return self.thread:joinable() | 141 | return self.thread:joinable() |
| 142 | end | 142 | end |
| 143 | 143 | ||
| 144 | --- Interrupt thread | ||
| 145 | -- The thread is interrupted by installing a debug hook that | ||
| 146 | -- creates an error. | ||
| 147 | -- @tparam ?boolean if not given, interrupt only once, | ||
| 148 | -- otherwise this arg sets or unsets permanent interrupt. | ||
| 149 | function thread_mt:interrupt(arg) | ||
| 150 | return self.thread:interrupt(arg) | ||
| 151 | end | ||
| 152 | |||
| 144 | end | 153 | end |
| 145 | ------------------------------------------------------------------------------- | 154 | ------------------------------------------------------------------------------- |
| 146 | 155 | ||
