Skip to content

Commit

Permalink
Fix cunstructor parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Mons committed Dec 12, 2022
1 parent 377130b commit 0ff2de6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sync/cond.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sync/latch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sync/lock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion sync/wg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0ff2de6

Please sign in to comment.