LGTM
On Wed, Apr 9, 2014 at 9:06 PM, Klaus Aehlig <[email protected]> wrote: > ...from a lock waiting structure. In this way, all the data > describing the behavior can be inspected. > > Signed-off-by: Klaus Aehlig <[email protected]> > --- > src/Ganeti/Locking/Waiting.hs | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/src/Ganeti/Locking/Waiting.hs b/src/Ganeti/Locking/Waiting.hs > index 477a6c8..2f99fe8 100644 > --- a/src/Ganeti/Locking/Waiting.hs > +++ b/src/Ganeti/Locking/Waiting.hs > @@ -32,6 +32,7 @@ module Ganeti.Locking.Waiting > , getPendingOwners > , removePendingRequest > , releaseResources > + , getPendingRequests > ) where > > import qualified Data.Map as M > @@ -93,6 +94,11 @@ getPendingOwners = M.keysSet . lwPendingOwners > getAllocation :: LockWaiting a b c -> L.LockAllocation a b > getAllocation = lwAllocation > > +-- | Get the list of all pending requests. > +getPendingRequests :: (Ord a, Ord b, Ord c) > + => LockWaiting a b c -> S.Set (c, b, [L.LockRequest a]) > +getPendingRequests = S.unions . M.elems . lwPending > + > -- | Internal function to fulfill one request if possible, and keep track > of > -- the owners to be notified. The type is chosen to be suitable as fold > -- operation. > -- > 1.9.1.423.g4596e3a > >
