public UnifiedBlockingObject(CRITICAL_SECTION section, ulong address) : this(BlockingObjectOrigin.StackWalker) { OwnerOSThreadIds.Add((uint)section.OwningThread); Reason = UnifiedBlockingReason.CriticalSection; Type = UnifiedBlockingType.CriticalSectionObject; Handle = address; }
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 UnifiedBlockingObject(BlockingObject obj) : this(BlockingObjectOrigin.ClrMD) { foreach (var owner in obj.Owners?.Where(o => o != null) ?? new ClrThread[0]) { OwnerOSThreadIds.Add(owner.OSThreadId); } foreach (var waiter in obj.Waiters?.Where(w => w != null) ?? new ClrThread[0]) { WaiterOSThreadIds.Add(waiter.OSThreadId); } Reason = (UnifiedBlockingReason)((int)obj.Reason); RecursionCount = obj.RecursionCount; ManagedObjectAddress = obj.Object; Type = UnifiedBlockingType.ClrBlockingObject; }
public UnifiedBlockingObject(HandleInfo handle) : this(BlockingObjectOrigin.MiniDumpHandles) { KernelObjectName = handle.ObjectName; KernelObjectTypeName = handle.TypeName; if (handle.Type != HandleInfo.HandleType.NONE) { Reason = ConvertToUnified(handle.Type); } else if (!String.IsNullOrEmpty(handle.TypeName)) { Reason = ConvertToUnified(handle.TypeName); } Type = UnifiedBlockingType.DumpHandle; Handle = handle.Handle; if (handle.OwnerThreadId != 0) // Note that this can be a thread in another process, too { OwnerOSThreadIds.Add(handle.OwnerThreadId); } }