From dc95267cdbe95e15092470d15ead892b80302167 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 12 Aug 2013 13:22:27 +0200 Subject: util.async: waiter: Throw error if done() called too many times --- util/async.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util/async.lua') 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 -- cgit v1.2.3