diff --git a/sync/cond.lua b/sync/cond.lua index 1b3ccde..c913b83 100644 --- a/sync/cond.lua +++ b/sync/cond.lua @@ -3,7 +3,7 @@ local fiber = require "fiber" local cond = {} cond.__index = cond cond.__tostring = function (self) return "cond<".. (self.name or 'anon') ..">" end -setmetatable(cond, { __call = function (_, name) return _.new(name) end }) +setmetatable(cond, { __call = function (_, ...) return _.new(...) end }) function cond.new(name, timeout) if name == cond then error("Usage: cond.new([name]) or cond([name]) (not cond:new())", 2) end diff --git a/sync/latch.lua b/sync/latch.lua index 4ecf29f..aabc18e 100644 --- a/sync/latch.lua +++ b/sync/latch.lua @@ -57,7 +57,7 @@ local function destroy(obj) C.box_latch_delete(obj) end -function latch.new(name, timeout) +function latch.new(name) if name == latch then error("Usage: latch.new([name]) or latch([name]) (not latch:new())", 2) end local obj = C.box_latch_new() if not obj then error("Failed to create latch") end diff --git a/sync/lock.lua b/sync/lock.lua index 5cfc0c4..370473e 100644 --- a/sync/lock.lua +++ b/sync/lock.lua @@ -15,7 +15,7 @@ local FIBER_STORE = 'sync.lock' -- return _G.print(fiber.id(), ...) -- end -function lock.new(name, timeout) +function lock.new(name) if name == lock then error("Usage: lock.new([name]) or lock([name]) (not lock:new())", 2) end return setmetatable({ name = name; diff --git a/sync/wg.lua b/sync/wg.lua index 6de98cd..7869e7a 100644 --- a/sync/wg.lua +++ b/sync/wg.lua @@ -3,7 +3,7 @@ local fiber = require "fiber" local wg = {} wg.__index = wg wg.__tostring = function (self) return "wg<".. (self.name or 'anon') ..">" end -setmetatable(wg, { __call = function (_, name) return _.new(name) end }) +setmetatable(wg, { __call = function (_, ...) return _.new(...) end }) function wg.new(name, timeout) if name == wg then error("Usage: wg.new([name]) or wg([name]) (not wg:new())", 2) end