private static IntObjectProcedure <LongObjectMap <LockResource> > CollectActiveLocks(IList <ActiveLock> locks, Org.Neo4j.Kernel.impl.locking.ActiveLock_Factory activeLock) { return((typeId, exclusive) => { ResourceType resourceType = ResourceTypes.fromId(typeId); exclusive.forEachKeyValue((resourceId, @lock) => { locks.Add(activeLock.Create(resourceType, resourceId)); }); }); }
private static void CollectActiveLocks(LongIntMap[] counts, IList <ActiveLock> locks, Org.Neo4j.Kernel.impl.locking.ActiveLock_Factory activeLock) { for (int typeId = 0; typeId < Counts.Length; typeId++) { LongIntMap lockCounts = counts[typeId]; if (lockCounts != null) { ResourceType resourceType = ResourceTypes.fromId(typeId); lockCounts.forEachKeyValue((resourceId, count) => locks.Add(activeLock.Create(resourceType, resourceId))); } } }