Table of Contents

Class JoinableTaskContext.HangDetails

Namespace
Microsoft.VisualStudio.Threading
Assembly
Microsoft.VisualStudio.Threading.dll

A class to encapsulate the details of a possible hang. An instance of this JoinableTaskContext.HangDetails class will be passed to the JoinableTaskContextNode instances who registered the hang notifications.

public class JoinableTaskContext.HangDetails
Inheritance
JoinableTaskContext.HangDetails
Inherited Members

Constructors

HangDetails(TimeSpan, int, Guid, MethodInfo?)

Initializes a new instance of the JoinableTaskContext.HangDetails class.

public HangDetails(TimeSpan hangDuration, int notificationCount, Guid hangId, MethodInfo? entryMethod)

Parameters

hangDuration TimeSpan

The duration of the current hang.

notificationCount int

The number of times this hang has been reported, including this one.

hangId Guid

A random GUID that uniquely identifies this particular hang.

entryMethod MethodInfo

The method that served as the entrypoint for the JoinableTask.

Properties

EntryMethod

Gets the method that served as the entrypoint for the JoinableTask that now blocks a thread.

public MethodInfo? EntryMethod { get; }

Property Value

MethodInfo

Remarks

The method indicated here may not be the one that is actually blocking a thread, but typically a deadlock is caused by a violation of a threading rule which is under the entrypoint's control. So usually regardless of where someone chooses the block a thread for the completion of a JoinableTask, a hang usually indicates a bug in the code that created it. This value may be used to assign the hangs to different buckets based on this method info.

HangDuration

Gets the length of time this hang has lasted so far.

public TimeSpan HangDuration { get; }

Property Value

TimeSpan

HangId

Gets a unique GUID identifying this particular hang. If the same hang is reported multiple times (with increasing duration values) the value of this property will remain constant.

public Guid HangId { get; }

Property Value

Guid

NotificationCount

Gets the number of times this particular hang has been reported, including this one.

public int NotificationCount { get; }

Property Value

int