Прочитај на енглеском Уреди

Делите путем


TaskCompletionSource Constructors

Definition

Overloads

TaskCompletionSource()

Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs
C#
public TaskCompletionSource();

Applies to

.NET 10 и друге верзије
Производ Верзије
.NET 5, 6, 7, 8, 9, 10

TaskCompletionSource(Object)

Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs

Creates a TaskCompletionSource with the specified state.

C#
public TaskCompletionSource(object? state);

Parameters

state
Object

The state to use as the underlying Task's AsyncState.

Applies to

.NET 10 и друге верзије
Производ Верзије
.NET 5, 6, 7, 8, 9, 10

TaskCompletionSource(TaskCreationOptions)

Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs

Creates a TaskCompletionSource with the specified options.

C#
public TaskCompletionSource(System.Threading.Tasks.TaskCreationOptions creationOptions);

Parameters

creationOptions
TaskCreationOptions

The options to use when creating the underlying Task.

Exceptions

One or more of the specified creationOptions are invalid for use with a TaskCompletionSource.

Remarks

The Task created by this instance and accessible through its Task property will be instantiated using the specified creationOptions.

Applies to

.NET 10 и друге верзије
Производ Верзије
.NET 5, 6, 7, 8, 9, 10

TaskCompletionSource(Object, TaskCreationOptions)

Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs
Source:
TaskCompletionSource.cs

Creates a TaskCompletionSource with the specified state and options.

C#
public TaskCompletionSource(object? state, System.Threading.Tasks.TaskCreationOptions creationOptions);

Parameters

state
Object

The state to use as the underlying Task's AsyncState.

creationOptions
TaskCreationOptions

The options to use when creating the underlying Task.

Exceptions

One or more of the specified creationOptions are invalid for use with a TaskCompletionSource.

Applies to

.NET 10 и друге верзије
Производ Верзије
.NET 5, 6, 7, 8, 9, 10