uwiger / locks

A scalable, deadlock-resolving resource locker
Mozilla Public License 2.0
204 stars 26 forks source link

In lock_objects the last lock_nowait is missing the last parameter, Req? #29

Open ryno opened 8 years ago

ryno commented 8 years ago

-spec lock_objects(pid(), objs()) -> ok. %% lock_objects(Agent, Objects) -> lists:foreach(fun({Obj, Mode}) when Mode == read; Mode == write -> lock_nowait(Agent, Obj, Mode); ({Obj, Mode, Where}) when Mode == read; Mode == write -> lock_nowait(Agent, Obj, Mode, Where); ({Obj, Mode, Where, Req}) when (Mode == read orelse Mode == write) andalso (Req == all orelse Req == any orelse Req == majority orelse Req == majority_alive orelse Req == all_alive) -> lock_nowait(Agent, Obj, Mode, Where); (L) -> error({illegal_lock_pattern, L}) end, Objects).

uwiger commented 8 years ago

Indeed. Will fix.