Commit f24f0e5c authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Export the set of pending requests



...from a lock waiting structure. In this way, all the data
describing the behavior can be inspected.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent f21ff016
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment