# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1521239472 0
# Node ID 937de0c392790584c58351f7550b2be1d8dd372d
# Parent  b03c7884fadefbad6614c39281b3999ee8839958
util.async: Add comment

diff -r b03c7884fade -r 937de0c39279 util/async.lua
--- a/util/async.lua	Fri Mar 16 22:30:25 2018 +0000
+++ b/util/async.lua	Fri Mar 16 22:31:12 2018 +0000
@@ -21,6 +21,7 @@
 		-- Running the coroutine failed, which means we have to find the runner manually,
 		-- in order to inform the error handler
 		local level = 0;
+		-- Find the 'level' of the top-most function (0 == current level, 1 == caller, ...)
 		while debug.getinfo(thread, level, "") do level = level + 1; end
 		ok, runner = debug.getlocal(thread, level-1, 1);
 		assert(ok == "self", "unexpected async state: variable mismatch");