aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/async.lua2
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