Пример #1
0
        public UnifiedBlockingObject(ThreadWCTInfo wct) : this(BlockingObjectOrigin.WaitChainTraversal)
        {
            var thisThread = wct.WaitChain[0];
            // We could extract wait time information, context switches, and some other potentially
            // useful data from `thisThread`. For now, ignore.

            var first = wct.WaitChain[1];

            Debug.Assert(first.ObjectType != WCT_OBJECT_TYPE.WctThreadType);

            KernelObjectName = first.ObjectName;
            Reason           = ConvertToUnified(first.ObjectType);
            Type             = UnifiedBlockingType.WaitChainInfoObject;

            if (wct.WaitChain.Count > 2)
            {
                var owner = wct.WaitChain[2];
                Debug.Assert(owner.ObjectType == WCT_OBJECT_TYPE.WctThreadType);

                if (owner.OSThreadId != 0)
                {
                    OwnerOSThreadIds.Add(owner.OSThreadId);
                }
            }
        }
Пример #2
0
        public override List <UnifiedBlockingObject> GetUnmanagedBlockingObjects(uint osThreadId)
        {
            var           blockingObjects = base.GetUnmanagedBlockingObjects(osThreadId);
            ThreadWCTInfo wctInfo         = _wctApi.GetBlockingObjects(osThreadId);

            if (wctInfo != null && wctInfo.WaitChain.Count > 1)
            {   // The first node is always the current thread, which is not that interesting.
                blockingObjects.Add(new UnifiedBlockingObject(wctInfo));
            }
            return(blockingObjects);
        }
Пример #3
0
        public UnifiedBlockingObject(ThreadWCTInfo wct) : this(BlockingObjectOrigin.WaitChainTraversal)
        {
            var thisThread = wct.WaitChain[0];
            // We could extract wait time information, context switches, and some other potentially
            // useful data from `thisThread`. For now, ignore.

            var first = wct.WaitChain[1];
            Debug.Assert(first.ObjectType != WCT_OBJECT_TYPE.WctThreadType);

            KernelObjectName = first.ObjectName;
            Reason = ConvertToUnified(first.ObjectType);
            Type = UnifiedBlockingType.WaitChainInfoObject;
            
            if (wct.WaitChain.Count > 2)
            {
                var owner = wct.WaitChain[2];
                Debug.Assert(owner.ObjectType == WCT_OBJECT_TYPE.WctThreadType);

                if (owner.OSThreadId != 0)
                    OwnerOSThreadIds.Add(owner.OSThreadId);
            }
        }