Open ryno opened 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).
Indeed. Will fix.
-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).