aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-03-22 16:26:09 +0000
committerMatthew Wild <mwild1@gmail.com>2018-03-22 16:26:09 +0000
commitd99a87a40c88cf1d5df4efee2a6deb8692562b55 (patch)
tree25ef10fca041a7614c05e0559ea8a8da88004313
parentd0eea7794a4d15831718b29efb495812d8960ddf (diff)
downloadprosody-d99a87a40c88cf1d5df4efee2a6deb8692562b55.tar.gz
prosody-d99a87a40c88cf1d5df4efee2a6deb8692562b55.zip
util.async: Allow nil as a guard key
-rw-r--r--util/async.lua2
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