LGTM
On Thu, Mar 6, 2014 at 2:37 PM, Klaus Aehlig <[email protected]> wrote: > To allow for clean up, add a function that provides the list > of all the owners holding at least one lock. > > Signed-off-by: Klaus Aehlig <[email protected]> > --- > src/Ganeti/Locking/Allocation.hs | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/src/Ganeti/Locking/Allocation.hs > b/src/Ganeti/Locking/Allocation.hs > index cf07040..cfc08e1 100644 > --- a/src/Ganeti/Locking/Allocation.hs > +++ b/src/Ganeti/Locking/Allocation.hs > @@ -27,6 +27,7 @@ module Ganeti.Locking.Allocation > ( LockAllocation > , emptyAllocation > , OwnerState(..) > + , lockOwners > , listLocks > , LockRequest(..) > , requestExclusive > @@ -112,6 +113,10 @@ emptyAllocation = > , laOwned = M.empty > } > > +-- | Obtain the list of all owners holding at least a single lock. > +lockOwners :: Ord b => LockAllocation a b -> [b] > +lockOwners = M.keys . laOwned > + > -- | Obtain the locks held by a given owner. The locks are reported > -- as a map from the owned locks to the form of ownership (OwnShared > -- or OwnExclusive). > -- > 1.9.0.279.gdc9e3eb > >
