This documentation is archived and is not being maintained.

AsyncFlowControl Structure

Provides the functionality to restore the migration, or flow, of the execution context between threads.

Namespace:  System.Threading
Assembly:  mscorlib (in mscorlib.dll)

public struct AsyncFlowControl : IDisposable

An execution context contains all execution-related information for a logical thread. The flow of the execution context to other threads can be prevented by using the ExecutionContext.SuppressFlow method, which returns an AsyncFlowControl structure. The Undo method of the returned AsyncFlowControl structure can be used to undo the flow suppression. The AsyncFlowControl structure must be used on the same thread on which it was created.

The following code example shows the use of the AsyncFlowControl class. This code example is part of a larger example provided for the ExecutionContext class.

Console.WriteLine("Suppress the flow of the execution context.");
AsyncFlowControl aFC = ExecutionContext.SuppressFlow();

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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0