AsyncFlowControl 结构

定义

提供功能以还原执行上下文在线程之间的迁移(或流动)。Provides the functionality to restore the migration, or flow, of the execution context between threads.

public value class AsyncFlowControl : IDisposable
public struct AsyncFlowControl : IDisposable
type AsyncFlowControl = struct
    interface IDisposable
Public Structure AsyncFlowControl
Implements IDisposable
继承
AsyncFlowControl
实现

注解

执行上下文包含逻辑线程的所有与执行相关的信息。An execution context contains all execution-related information for a logical thread. 可以通过使用 ExecutionContext.SuppressFlow 方法(该方法返回 AsyncFlowControl 结构)阻止执行上下文流向其他线程。The flow of the execution context to other threads can be prevented by using the ExecutionContext.SuppressFlow method, which returns an AsyncFlowControl structure. 返回的 AsyncFlowControl 结构的 Undo 方法可用于撤消流禁止显示。The Undo method of the returned AsyncFlowControl structure can be used to undo the flow suppression. AsyncFlowControl 结构必须在创建该结构的线程上使用。The AsyncFlowControl structure must be used on the same thread on which it was created.

方法

Dispose()

释放由 AsyncFlowControl 类的当前实例占用的所有资源。Releases all resources used by the current instance of the AsyncFlowControl class.

Equals(AsyncFlowControl)

确定指定 AsyncFlowControl 结构是否等于当前 AsyncFlowControl 结构。Determines whether the specified AsyncFlowControl structure is equal to the current AsyncFlowControl structure.

Equals(Object)

确定指定对象是否等于当前 AsyncFlowControl 结构。Determines whether the specified object is equal to the current AsyncFlowControl structure.

GetHashCode()

获取当前 AsyncFlowControl 结构的哈希代码。Gets a hash code for the current AsyncFlowControl structure.

Undo()

还原执行上下文在线程之间的流动。Restores the flow of the execution context between threads.

运算符

Equality(AsyncFlowControl, AsyncFlowControl)

比较两个 AsyncFlowControl 结构以确定它们是否相等。Compares two AsyncFlowControl structures to determine whether they are equal.

Inequality(AsyncFlowControl, AsyncFlowControl)

比较两个 AsyncFlowControl 结构以确定它们是否不相等。Compares two AsyncFlowControl structures to determine whether they are not equal.

显式接口实现

IDisposable.Dispose()

释放 AsyncFlowControl 使用的所有资源。Releases all resources used by the AsyncFlowControl.

适用于