.NET Framework Class Library |
TaskFactory Constructor (CancellationToken) |
TaskFactory Class See Also Send Feedback |
Initializes a TaskFactory instance with the specified configuration.
Namespace:
System.Threading.Tasks
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Sub New ( _ cancellationToken As CancellationToken _ ) |
C# |
---|
public TaskFactory( CancellationToken cancellationToken ) |
Parameters
- cancellationToken
- Type: System.Threading..::.CancellationToken
The default CancellationToken that will be assigned to tasks created by this TaskFactory unless another CancellationToken is explicitly specified while calling the factory methods.
Remarks
This constructor creates a TaskFactory instance with a default configuration. The
TaskCreationOptions property is initialized to
TaskCreationOptions.None, the
TaskContinuationOptions property is initialized to TaskContinuationOptions.None,
and the TaskScheduler property is
initialized to the current scheduler (see TaskScheduler.Current).