# HG changeset patch # User Matthew Wild # Date 1521735969 0 # Node ID ba6a6a04b46c0d08bd8ac30144d81fddf0a8140c # Parent 425de10efde4d2a94d1a29b80d2987f5cf15d65e util.async: Allow nil as a guard key diff -r 425de10efde4 -r ba6a6a04b46c util/async.lua --- a/util/async.lua Thu Mar 22 16:25:20 2018 +0000 +++ b/util/async.lua Thu Mar 22 16:26:09 2018 +0000 @@ -84,7 +84,9 @@ 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