共用方式為


JoinableTaskContext Class

A common context within which joinable tasks may be created and interact to avoid deadlocks.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Threading.JoinableTaskContext

Namespace:  Microsoft.VisualStudio.Threading
Assembly:  Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)

Syntax

'Declaration
Public Class JoinableTaskContext _
    Implements IHangReportContributor
public class JoinableTaskContext : IHangReportContributor
public ref class JoinableTaskContext : IHangReportContributor
type JoinableTaskContext =  
    class 
        interface IHangReportContributor 
    end
public class JoinableTaskContext implements IHangReportContributor

The JoinableTaskContext type exposes the following members.

Constructors

  Name Description
Public method JoinableTaskContext Initializes a new instance of the JoinableTaskContext.

Top

Properties

  Name Description
Public property Factory Gets the factory which creates joinable tasks that do not belong to a joinable task collection.
Public property IsWithinJoinableTask Determines whether the caller is currently running in the context of a joinable task.
Public property MainThread Gets the main thread that can be shared by tasks created by this context.

Top

Methods

  Name Description
Public method CreateCollection Creates a collection for in-flight joinable tasks.
Protected method CreateDefaultFactory Creates a factory without a JoinableTaskCollection.
Public method CreateFactory Creates a joinable task factory that automatically adds all created tasks to a collection that can be jointly joined.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method IsMainThreadBlocked Determines whether the main thread is blocked for the caller's completion.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method OnHangDetected Called when a hang is suspected to have occurred involving the main thread.
Public method SuppressRelevance Conceals any ticket to the Main thread until the returned value is disposed.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IHangReportContributor.GetHangReport Contributes data for a hang report.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Threading Namespace