Changeset

5793:e8c79796ead9

util.async: waiter: Throw error if done() called too many times
author Kim Alvefur <zash@zash.se>
date Mon, 12 Aug 2013 13:22:27 +0200
parents 5792:aac4c6147647
children 5794:66c3ad5d29ad
files util/async.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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