aboutsummaryrefslogtreecommitdiffstats
path: root/util/async.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-03-16 22:31:12 +0000
committerMatthew Wild <mwild1@gmail.com>2018-03-16 22:31:12 +0000
commit3059744ca4e528a216a506414ade709afe462b6c (patch)
tree655e6a6434a1bc90a916dea7b2ba493fca0f3b4f /util/async.lua
parent357476b690e4815c02003dc69e7508b123a2a9a6 (diff)
downloadprosody-3059744ca4e528a216a506414ade709afe462b6c.tar.gz
prosody-3059744ca4e528a216a506414ade709afe462b6c.zip
util.async: Add comment
Diffstat (limited to 'util/async.lua')
-rw-r--r--util/async.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/async.lua b/util/async.lua
index e16d5b24..205db183 100644
--- a/util/async.lua
+++ b/util/async.lua
@@ -21,6 +21,7 @@ local function runner_continue(thread)
-- 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");