Software /
code /
prosody
Changeset
8611:937de0c39279
util.async: Add comment
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 16 Mar 2018 22:31:12 +0000 |
parents | 8610:b03c7884fade |
children | 8612:1f2fb8070c7c |
files | util/async.lua |
diffstat | 1 files changed, 1 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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");