diff options
author | Kim Alvefur <zash@zash.se> | 2013-08-12 13:22:27 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2013-08-12 13:22:27 +0200 |
commit | 0e702abb1f191bbf83bf3b24a99536fa4dc3dd73 (patch) | |
tree | 6cf0994c6b3b56a8aa23b3e067ea59e28776fe5b | |
parent | 516179867e7ffbe56343375aa0d8abcf41dee83a (diff) | |
download | prosody-0e702abb1f191bbf83bf3b24a99536fa4dc3dd73.tar.gz prosody-0e702abb1f191bbf83bf3b24a99536fa4dc3dd73.zip |
util.async: waiter: Throw error if done() called too many times
-rw-r--r-- | util/async.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/util/async.lua b/util/async.lua index c81f8639..d0bc6c3d 100644 --- a/util/async.lua +++ b/util/async.lua @@ -37,6 +37,8 @@ local function waiter(num) num = num - 1; if num == 0 and waiting then runner_continue(thread); + elseif num < 0 then + error("done() called too many times"); end end; end |