Beispiel #1
0
        private void EvaluateDirectDependencies(IDictionary <KernelTransactionHandle, ISet <KernelTransactionHandle> > directDependencies, IDictionary <KernelTransactionHandle, IList <ActiveLock> > handleLocksMap, KernelTransactionHandle txHandle, QuerySnapshot querySnapshot)
        {
            IList <ActiveLock> waitingOnLocks = querySnapshot.WaitingLocks();

            foreach (ActiveLock activeLock in waitingOnLocks)
            {
                foreach (KeyValuePair <KernelTransactionHandle, IList <ActiveLock> > handleListEntry in handleLocksMap.SetOfKeyValuePairs())
                {
                    KernelTransactionHandle kernelTransactionHandle = handleListEntry.Key;
                    if (!kernelTransactionHandle.Equals(txHandle))
                    {
                        if (IsBlocked(activeLock, handleListEntry.Value))
                        {
                            ISet <KernelTransactionHandle> kernelTransactionHandles = directDependencies.computeIfAbsent(txHandle, handle => new HashSet <KernelTransactionHandle>());
                            kernelTransactionHandles.Add(kernelTransactionHandle);
                        }
                    }
                }
            }
        }