|
@@ -6,44 +6,6 @@ namespace System.Threading.Tasks
|
|
|
{
|
|
|
internal static class TaskExtensions
|
|
|
{
|
|
|
- public static Task ContinueWithState<TState>(this Task task, Action<Task, TState> continuationAction, TState state)
|
|
|
- {
|
|
|
- return task.ContinueWith(
|
|
|
- (t, tupleObject) =>
|
|
|
- {
|
|
|
- var (closureAction, closureState) = ((Action<Task, TState>, TState))tupleObject!;
|
|
|
-
|
|
|
- closureAction(t, closureState);
|
|
|
- },
|
|
|
- (continuationAction, state));
|
|
|
- }
|
|
|
-
|
|
|
- public static Task ContinueWithState<TState>(this Task task, Action<Task, TState> continuationAction, TState state, CancellationToken cancellationToken)
|
|
|
- {
|
|
|
- return task.ContinueWith(
|
|
|
- (t, tupleObject) =>
|
|
|
- {
|
|
|
- var (closureAction, closureState) = ((Action<Task, TState>, TState))tupleObject!;
|
|
|
-
|
|
|
- closureAction(t, closureState);
|
|
|
- },
|
|
|
- (continuationAction, state),
|
|
|
- cancellationToken);
|
|
|
- }
|
|
|
-
|
|
|
- public static Task ContinueWithState<TState>(this Task task, Action<Task, TState> continuationAction, TState state, TaskContinuationOptions continuationOptions)
|
|
|
- {
|
|
|
- return task.ContinueWith(
|
|
|
- (t, tupleObject) =>
|
|
|
- {
|
|
|
- var (closureAction, closureState) = ((Action<Task, TState>, TState))tupleObject!;
|
|
|
-
|
|
|
- closureAction(t, closureState);
|
|
|
- },
|
|
|
- (continuationAction, state),
|
|
|
- continuationOptions);
|
|
|
- }
|
|
|
-
|
|
|
public static Task ContinueWithState<TState>(this Task task, Action<Task, TState> continuationAction, TState state, CancellationToken cancellationToken, TaskContinuationOptions continuationOptions)
|
|
|
{
|
|
|
return task.ContinueWith(
|
|
@@ -59,18 +21,6 @@ namespace System.Threading.Tasks
|
|
|
TaskScheduler.Default);
|
|
|
}
|
|
|
|
|
|
- public static Task ContinueWithState<TResult, TState>(this Task<TResult> task, Action<Task<TResult>, TState> continuationAction, TState state)
|
|
|
- {
|
|
|
- return task.ContinueWith(
|
|
|
- (t, tupleObject) =>
|
|
|
- {
|
|
|
- var (closureAction, closureState) = ((Action<Task<TResult>, TState>, TState))tupleObject!;
|
|
|
-
|
|
|
- closureAction(t, closureState);
|
|
|
- },
|
|
|
- (continuationAction, state));
|
|
|
- }
|
|
|
-
|
|
|
public static Task ContinueWithState<TResult, TState>(this Task<TResult> task, Action<Task<TResult>, TState> continuationAction, TState state, CancellationToken cancellationToken)
|
|
|
{
|
|
|
return task.ContinueWith(
|
|
@@ -84,19 +34,6 @@ namespace System.Threading.Tasks
|
|
|
cancellationToken);
|
|
|
}
|
|
|
|
|
|
- public static Task ContinueWithState<TResult, TState>(this Task<TResult> task, Action<Task<TResult>, TState> continuationAction, TState state, TaskContinuationOptions continuationOptions)
|
|
|
- {
|
|
|
- return task.ContinueWith(
|
|
|
- (t, tupleObject) =>
|
|
|
- {
|
|
|
- var (closureAction, closureState) = ((Action<Task<TResult>, TState>, TState))tupleObject!;
|
|
|
-
|
|
|
- closureAction(t, closureState);
|
|
|
- },
|
|
|
- (continuationAction, state),
|
|
|
- continuationOptions);
|
|
|
- }
|
|
|
-
|
|
|
public static Task ContinueWithState<TResult, TState>(this Task<TResult> task, Action<Task<TResult>, TState> continuationAction, TState state, CancellationToken cancellationToken, TaskContinuationOptions continuationOptions)
|
|
|
{
|
|
|
return task.ContinueWith(
|