# HG changeset patch # User Kim Alvefur # Date 1376306547 -7200 # Node ID e8c79796ead981ee0ecb173a4c22e144cc19688d # Parent aac4c6147647a8f5afc39fe468ab06dd3f7568ff util.async: waiter: Throw error if done() called too many times diff -r aac4c6147647 -r e8c79796ead9 util/async.lua --- a/util/async.lua Mon Aug 12 12:08:51 2013 +0100 +++ b/util/async.lua Mon Aug 12 13:22:27 2013 +0200 @@ -37,6 +37,8 @@ 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