aboutsummaryrefslogtreecommitdiffstats
path: root/util
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
commite3fd2037fc259390a431bf80521f8c7ac1976885 (patch)
tree25ef10fca041a7614c05e0559ea8a8da88004313 /util
parent576f77a1c83b4db03f00c0bed4d884bd1afca626 (diff)
downloadprosody-e3fd2037fc259390a431bf80521f8c7ac1976885.tar.gz
prosody-e3fd2037fc259390a431bf80521f8c7ac1976885.zip
util.async: Allow nil as a guard key
Diffstat (limited to 'util')
-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