diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-03-22 16:26:09 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-03-22 16:26:09 +0000 |
commit | d99a87a40c88cf1d5df4efee2a6deb8692562b55 (patch) | |
tree | 25ef10fca041a7614c05e0559ea8a8da88004313 | |
parent | d0eea7794a4d15831718b29efb495812d8960ddf (diff) | |
download | prosody-d99a87a40c88cf1d5df4efee2a6deb8692562b55.tar.gz prosody-d99a87a40c88cf1d5df4efee2a6deb8692562b55.zip |
util.async: Allow nil as a guard key
-rw-r--r-- | util/async.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/util/async.lua b/util/async.lua index 7a8bd686..e8469e51 100644 --- a/util/async.lua +++ b/util/async.lua @@ -84,7 +84,9 @@ end local function guarder() local guards = {}; + local default_id = {}; return function (id, func) + id = id or default_id; local thread = checkthread(); local guard = guards[id]; if not guard then |