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); } } }
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); }
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); } }