5 types derived from Task
mscorlib (5)
system\threading\Tasks\Future.cs (1)
74
public class Task<TResult> :
Task
system\threading\Tasks\Task.cs (2)
6725
internal class ParallelForReplicatingTask :
Task
6775
internal class ParallelForReplicaTask :
Task
system\threading\Tasks\TaskContinuation.cs (2)
29
internal sealed class ContinuationTaskFromTask :
Task
125
internal sealed class ContinuationTaskFromResultTask<TAntecedentResult> :
Task
17 instantiations of Task
mscorlib (10)
system\runtime\compilerservices\AsyncMethodBuilder.cs (1)
252
if (m_task == null) m_task = new
Task
();
system\threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (2)
299
processingTask = new
Task
(thisPair => ((ConcurrentExclusiveSchedulerPair)thisPair).ProcessExclusiveTasks(), this,
326
processingTask = new
Task
(thisPair => ((ConcurrentExclusiveSchedulerPair)thisPair).ProcessConcurrentTasks(), this,
system\threading\Tasks\FutureFactory.cs (1)
720
Task t = new
Task
(delegate
system\threading\Tasks\Parallel.cs (1)
369
tasks[0] = new
Task
(actionsCopy[0]);
system\threading\Tasks\Task.cs (4)
1290
Task t = new
Task
(action, state, creatingTask, cancellationToken, options, internalOptions | InternalTaskOptions.QueuedByRuntime, scheduler);
1656
s_completedTask = completedTask = new
Task
(false, (TaskCreationOptions)InternalTaskOptions.DoNotDispose, default(CancellationToken)); // benign initialization ----
2535
return new
Task
(taskReplicaDelegate, stateObject, parentTask, default(CancellationToken),
5554
return new
Task
(true, TaskCreationOptions.None, cancellationToken);
system\threading\Tasks\TaskContinuation.cs (1)
593
return new
Task
(
System.Core (6)
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (1)
175
Task rootTask = new
Task
(
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (1)
91
Task rootTask = new
Task
(
System\Linq\Parallel\Scheduling\QueryTask.cs (1)
68
Task task = new
Task
(s_runTaskSynchronouslyDelegate, this, TaskCreationOptions.AttachedToParent);
System\Linq\Parallel\Scheduling\SpoolingTask.cs (3)
45
Task rootTask = new
Task
(
100
Task rootTask = new
Task
(
142
Task rootTask = new
Task
(
System.Web (1)
Util\SynchronizationHelper.cs (1)
213
Interlocked.Exchange(ref _completionTask, new
Task
(continuation));
2103 references to Task
mscorlib (1054)
system\io\bufferedstream.cs (21)
332
public override
Task
FlushAsync(CancellationToken cancellationToken) {
335
return
Task
.FromCancellation<Int32>(cancellationToken);
343
private static async
Task
FlushAsyncInternal(CancellationToken cancellationToken,
452
private async
Task
FlushWriteAsync(CancellationToken cancellationToken) {
588
Task
semaphoreLockTask = sem.WaitAsync();
629
Int32 bytesAlreadySatisfied,
Task
semaphoreLockTask) {
659
t =
Task
.FromResult<Int32>(val);
679
return
Task
.FromCancellation<Int32>(cancellationToken);
689
Task
semaphoreLockTask = sem.WaitAsync();
710
:
Task
.FromException<Int32>(error);
734
Task
semaphoreLockTask, bool useApmPattern) {
1016
Task
semaphoreLockTask = sem.WaitAsync();
1054
Task
semaphoreLockTask) {
1056
Task
writeOp = WriteToUnderlyingStreamAsync(buffer, offset, count, CancellationToken.None, semaphoreLockTask, useApmPattern: true);
1077
public override
Task
WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) {
1091
return
Task
.FromCancellation<Int32>(cancellationToken);
1100
Task
semaphoreLockTask = sem.WaitAsync();
1121
?
Task
.CompletedTask
1122
:
Task
.FromException(error);
1141
private async
Task
WriteToUnderlyingStreamAsync(Byte[] array, Int32 offset, Int32 count,
1143
Task
semaphoreLockTask, bool useApmPattern) {
system\io\filestream.cs (8)
2623
return
Task
.FromCancellation<int>(cancellationToken);
2655
public override
Task
WriteAsync(Byte[] buffer, int offset, int count, CancellationToken cancellationToken)
2675
return
Task
.FromCancellation(cancellationToken);
2828
public override
Task
FlushAsync(CancellationToken cancellationToken)
2838
return
Task
.FromCancellation(cancellationToken);
2856
return
Task
.FromException(e);
2860
return
Task
.Factory.StartNew(
2867
return
Task
.CompletedTask;
system\io\memorystream.cs (17)
196
public override
Task
FlushAsync(CancellationToken cancellationToken) {
199
return
Task
.FromCancellation(cancellationToken);
204
return
Task
.CompletedTask;
208
return
Task
.FromException(ex);
389
return
Task
.FromCancellation<int>(cancellationToken);
397
return (t != null && t.Result == n) ? t : (_lastReadTask =
Task
.FromResult<int>(n));
401
return
Task
.FromCancellation<int>(oce);
405
return
Task
.FromException<int>(exception);
421
public override
Task
CopyToAsync(Stream destination, Int32 bufferSize, CancellationToken cancellationToken) {
455
return
Task
.FromCancellation(cancellationToken);
473
return
Task
.CompletedTask;
476
return
Task
.FromException(ex);
602
public override
Task
WriteAsync(Byte[] buffer, int offset, int count, CancellationToken cancellationToken)
616
return
Task
.FromCancellation(cancellationToken);
621
return
Task
.CompletedTask;
625
return
Task
.FromCancellation<VoidTaskResult>(oce);
629
return
Task
.FromException(exception);
system\io\stream.cs (24)
129
public
Task
CopyToAsync(Stream destination)
136
public
Task
CopyToAsync(Stream destination, Int32 bufferSize)
143
public virtual
Task
CopyToAsync(Stream destination, Int32 bufferSize, CancellationToken cancellationToken)
162
private async
Task
CopyToAsyncInternal(Stream destination, Int32 bufferSize, CancellationToken cancellationToken)
276
public
Task
FlushAsync()
283
public virtual
Task
FlushAsync(CancellationToken cancellationToken)
285
return
Task
.Factory.StartNew(state => ((Stream)state).Flush(), this,
326
Task
semaphoreTask = null;
343
var thisTask =
Task
.InternalCurrent as ReadWriteTask;
422
?
Task
.FromCancellation<int>(cancellationToken)
472
Task
semaphoreTask = null;
489
var thisTask =
Task
.InternalCurrent as ReadWriteTask;
509
private void RunReadWriteTaskWhenReady(
Task
asyncWaiter, ReadWriteTask readWriteTask)
677
void ITaskCompletionAction.Invoke(
Task
completingTask)
705
public
Task
WriteAsync(Byte[] buffer, int offset, int count)
712
public virtual
Task
WriteAsync(Byte[] buffer, int offset, int count, CancellationToken cancellationToken)
717
?
Task
.FromCancellation(cancellationToken)
722
private
Task
BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count)
897
public override
Task
FlushAsync(CancellationToken cancellationToken)
900
Task
.FromCancellation(cancellationToken) :
901
Task
.CompletedTask;
967
public override
Task
WriteAsync(Byte[] buffer, int offset, int count, CancellationToken cancellationToken)
970
Task
.FromCancellation(cancellationToken) :
971
Task
.CompletedTask;
system\io\streamreader.cs (2)
111
private volatile
Task
_asyncReadTask;
118
Task
t = _asyncReadTask;
system\io\streamwriter.cs (26)
81
private volatile
Task
_asyncWriteTask;
88
Task
t = _asyncWriteTask;
450
public override
Task
WriteAsync(char value)
464
Task
task = WriteAsyncInternal(this, value, charBuffer, charPos, charLen, CoreNewLine, autoFlush, appendNewLine: false);
473
private static async
Task
WriteAsyncInternal(StreamWriter _this, Char value,
512
public override
Task
WriteAsync(String value)
528
Task
task = WriteAsyncInternal(this, value, charBuffer, charPos, charLen, CoreNewLine, autoFlush, appendNewLine: false);
535
return
Task
.CompletedTask;
542
private static async
Task
WriteAsyncInternal(StreamWriter _this, String value,
598
public override
Task
WriteAsync(char[] buffer, int index, int count)
622
Task
task = WriteAsyncInternal(this, buffer, index, count, charBuffer, charPos, charLen, CoreNewLine, autoFlush, appendNewLine: false);
631
private static async
Task
WriteAsyncInternal(StreamWriter _this, Char[] buffer, Int32 index, Int32 count,
686
public override
Task
WriteLineAsync()
700
Task
task = WriteAsyncInternal(this, null, 0, 0, charBuffer, charPos, charLen, CoreNewLine, autoFlush, appendNewLine: true);
709
public override
Task
WriteLineAsync(char value)
723
Task
task = WriteAsyncInternal(this, value, charBuffer, charPos, charLen, CoreNewLine, autoFlush, appendNewLine: true);
732
public override
Task
WriteLineAsync(String value)
746
Task
task = WriteAsyncInternal(this, value, charBuffer, charPos, charLen, CoreNewLine, autoFlush, appendNewLine: true);
755
public override
Task
WriteLineAsync(char[] buffer, int index, int count)
779
Task
task = WriteAsyncInternal(this, buffer, index, count, charBuffer, charPos, charLen, CoreNewLine, autoFlush, appendNewLine: true);
788
public override
Task
FlushAsync()
806
Task
task = FlushAsyncInternal(true, true, charBuffer, charPos);
820
private
Task
FlushAsyncInternal(bool flushStream, bool flushEncoder,
825
return
Task
.CompletedTask;
827
Task
flushTask = FlushAsyncInternal(this, flushStream, flushEncoder, sCharBuffer, sCharPos, this.haveWrittenPreamble,
837
private static async
Task
FlushAsyncInternal(StreamWriter _this, bool flushStream, bool flushEncoder,
system\io\stringreader.cs (4)
153
return
Task
.FromResult(ReadLine());
159
return
Task
.FromResult(ReadToEnd());
174
return
Task
.FromResult(ReadBlock(buffer, index, count));
188
return
Task
.FromResult(Read(buffer, index, count));
system\io\stringwriter.cs (14)
140
public override
Task
WriteAsync(char value)
143
return
Task
.CompletedTask;
148
public override
Task
WriteAsync(String value)
151
return
Task
.CompletedTask;
156
public override
Task
WriteAsync(char[] buffer, int index, int count)
159
return
Task
.CompletedTask;
164
public override
Task
WriteLineAsync(char value)
167
return
Task
.CompletedTask;
172
public override
Task
WriteLineAsync(String value)
175
return
Task
.CompletedTask;
180
public override
Task
WriteLineAsync(char[] buffer, int index, int count)
183
return
Task
.CompletedTask;
188
public override
Task
FlushAsync()
190
return
Task
.CompletedTask;
system\io\textreader.cs (4)
381
return
Task
.FromResult(ReadLine());
388
return
Task
.FromResult(ReadToEnd());
404
return
Task
.FromResult(ReadBlock(buffer, index, count));
419
return
Task
.FromResult(Read(buffer, index, count));
system\io\textwriter.cs (33)
541
public virtual
Task
WriteAsync(char value)
544
return
Task
.Factory.StartNew(_WriteCharDelegate, tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
549
public virtual
Task
WriteAsync(String value)
552
return
Task
.Factory.StartNew(_WriteStringDelegate, tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
557
public
Task
WriteAsync(char[] buffer)
559
if (buffer == null) return
Task
.CompletedTask;
565
public virtual
Task
WriteAsync(char[] buffer, int index, int count)
568
return
Task
.Factory.StartNew(_WriteCharArrayRangeDelegate, tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
573
public virtual
Task
WriteLineAsync(char value)
576
return
Task
.Factory.StartNew(_WriteLineCharDelegate, tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
581
public virtual
Task
WriteLineAsync(String value)
584
return
Task
.Factory.StartNew(_WriteLineStringDelegate, tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
589
public
Task
WriteLineAsync(char[] buffer)
591
if (buffer == null) return
Task
.CompletedTask;
597
public virtual
Task
WriteLineAsync(char[] buffer, int index, int count)
600
return
Task
.Factory.StartNew(_WriteLineCharArrayRangeDelegate, tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
605
public virtual
Task
WriteLineAsync()
612
public virtual
Task
FlushAsync()
614
return
Task
.Factory.StartNew(_FlushDelegate, this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
874
public override
Task
WriteAsync(char value)
877
return
Task
.CompletedTask;
882
public override
Task
WriteAsync(String value)
885
return
Task
.CompletedTask;
890
public override
Task
WriteAsync(char[] buffer, int index, int count)
893
return
Task
.CompletedTask;
898
public override
Task
WriteLineAsync(char value)
901
return
Task
.CompletedTask;
906
public override
Task
WriteLineAsync(String value)
909
return
Task
.CompletedTask;
914
public override
Task
WriteLineAsync(char[] buffer, int index, int count)
917
return
Task
.CompletedTask;
922
public override
Task
FlushAsync()
925
return
Task
.CompletedTask;
system\io\unmanagedmemorystream.cs (11)
292
public override
Task
FlushAsync(CancellationToken cancellationToken) {
295
return
Task
.FromCancellation(cancellationToken);
300
return
Task
.CompletedTask;
304
return
Task
.FromException(ex);
460
return
Task
.FromCancellation<Int32>(cancellationToken);
466
return (t != null && t.Result == n) ? t : (_lastReadTask =
Task
.FromResult<Int32>(n));
471
return
Task
.FromException<Int32>(ex);
644
public override
Task
WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) {
657
return
Task
.FromCancellation(cancellationToken);
662
return
Task
.CompletedTask;
667
return
Task
.FromException<Int32>(ex);
system\io\unmanagedmemorystreamwrapper.cs (3)
153
public override
Task
CopyToAsync(Stream destination, Int32 bufferSize, CancellationToken cancellationToken) {
180
public override
Task
FlushAsync(CancellationToken cancellationToken) {
192
public override
Task
WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) {
system\runtime\compilerservices\AsyncMethodBuilder.cs (19)
46
private
Task
m_task;
248
private
Task
Task
268
/// Provides a builder for asynchronous methods that return <see cref="System.Threading.Tasks.
Task
"/>.
363
/// <summary>Gets the <see cref="System.Threading.Tasks.
Task
"/> for this builder.</summary>
364
/// <returns>The <see cref="System.Threading.Tasks.
Task
"/> representing the builder's asynchronous operation.</returns>
366
public
Task
Task { get { return m_builder.Task; } }
369
/// Completes the <see cref="System.Threading.Tasks.
Task
"/> in the
382
/// Completes the <see cref="System.Threading.Tasks.
Task
"/> in the
603
if (System.Threading.Tasks.
Task
.s_asyncDebuggingEnabled)
605
System.Threading.Tasks.
Task
.RemoveFromActiveTasks(task.Id);
902
internal Action GetCompletionAction(
Task
taskForTracing, ref MoveNextRunner runnerToInitialize)
968
private Action OutputAsyncCausalityEvents(
Task
innerTask, Action continuation)
981
internal void PostBoxInitialization(IAsyncStateMachine stateMachine, MoveNextRunner runner,
Task
builtTask)
988
if (System.Threading.Tasks.
Task
.s_asyncDebuggingEnabled)
989
System.Threading.Tasks.
Task
.AddToActiveTasks(builtTask);
1105
internal readonly
Task
m_innerTask; // If the continuation is logically going to invoke a task, this is that task (may be null)
1107
internal ContinuationWrapper(Action continuation, Action invokeAction,
Task
innerTask)
1126
internal static Action CreateContinuationWrapper(Action continuation, Action invokeAction,
Task
innerTask = null)
1152
internal static
Task
TryGetContinuationTask(Action action)
system\runtime\compilerservices\TaskAwaiter.cs (36)
61
/// <summary>Provides an awaiter for awaiting a <see cref="System.Threading.Tasks.
Task
"/>.</summary>
67
private readonly
Task
m_task;
70
/// <param name="task">The <see cref="System.Threading.Tasks.
Task
"/> to be awaited.</param>
71
internal TaskAwaiter(
Task
task)
85
/// <summary>Schedules the continuation onto the <see cref="System.Threading.Tasks.
Task
"/> associated with this <see cref="TaskAwaiter"/>.</summary>
96
/// <summary>Schedules the continuation onto the <see cref="System.Threading.Tasks.
Task
"/> associated with this <see cref="TaskAwaiter"/>.</summary>
107
/// <summary>Ends the await on the completed <see cref="System.Threading.Tasks.
Task
"/>.</summary>
121
internal static void ValidateEnd(
Task
task)
137
private static void HandleNonSuccessAndDebuggerNotification(
Task
task)
160
private static void ThrowForNonSuccess(
Task
task)
199
/// <summary>Schedules the continuation onto the <see cref="System.Threading.Tasks.
Task
"/> associated with this <see cref="TaskAwaiter"/>.</summary>
209
internal static void OnCompletedInternal(
Task
task, Action continuation, bool continueOnCapturedContext, bool flowExecutionContext)
216
if ( TplEtwProvider.Log.IsEnabled() ||
Task
.s_asyncDebuggingEnabled)
231
private static Action OutputWaitEtwEvents(
Task
task, Action continuation)
236
if (
Task
.s_asyncDebuggingEnabled)
238
Task
.AddToActiveTasks(task);
246
var
currentTaskAtBegin =
Task
.InternalCurrent;
249
var
continuationTask = AsyncMethodBuilderCore.TryGetContinuationTask(continuation);
264
if (
Task
.s_asyncDebuggingEnabled)
266
Task
.RemoveFromActiveTasks(task.Id);
274
var
currentTaskAtEnd =
Task
.InternalCurrent;
322
/// <summary>Schedules the continuation onto the <see cref="System.Threading.Tasks.
Task
"/> associated with this <see cref="TaskAwaiter"/>.</summary>
333
/// <summary>Schedules the continuation onto the <see cref="System.Threading.Tasks.
Task
"/> associated with this <see cref="TaskAwaiter"/>.</summary>
356
/// <summary>Provides an awaitable object that allows for configured awaits on <see cref="System.Threading.Tasks.
Task
"/>.</summary>
364
/// <param name="task">The awaitable <see cref="System.Threading.Tasks.
Task
"/>.</param>
368
internal ConfiguredTaskAwaitable(
Task
task, bool continueOnCapturedContext)
387
private readonly
Task
m_task;
392
/// <param name="task">The <see cref="System.Threading.Tasks.
Task
"/> to await.</param>
397
internal ConfiguredTaskAwaiter(
Task
task, bool continueOnCapturedContext)
412
/// <summary>Schedules the continuation onto the <see cref="System.Threading.Tasks.
Task
"/> associated with this <see cref="TaskAwaiter"/>.</summary>
423
/// <summary>Schedules the continuation onto the <see cref="System.Threading.Tasks.
Task
"/> associated with this <see cref="TaskAwaiter"/>.</summary>
434
/// <summary>Ends the await on the completed <see cref="System.Threading.Tasks.
Task
"/>.</summary>
500
/// <summary>Schedules the continuation onto the <see cref="System.Threading.Tasks.
Task
"/> associated with this <see cref="TaskAwaiter"/>.</summary>
511
/// <summary>Schedules the continuation onto the <see cref="System.Threading.Tasks.
Task
"/> associated with this <see cref="TaskAwaiter"/>.</summary>
system\runtime\compilerservices\YieldAwaitable.cs (4)
123
Task
.Factory.StartNew(continuation, default(CancellationToken), TaskCreationOptions.PreferFairness, scheduler);
130
int continuationId =
Task
.NewId();
131
Task
currentTask =
Task
.InternalCurrent;
system\security\cryptography\cryptostream.cs (8)
156
public override
Task
FlushAsync(CancellationToken cancellationToken)
166
Task
.FromCancellation(cancellationToken) :
167
Task
.CompletedTask;
328
return
Task
.FromCancellation<int>(cancellationToken);
338
public void OnCompleted(Action continuation) {
Task
.Run(continuation); }
571
public override
Task
WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
592
return
Task
.FromCancellation(cancellationToken);
597
private async
Task
WriteAsyncInternal(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
system\threading\SemaphoreSlim.cs (5)
482
public
Task
WaitAsync()
498
public
Task
WaitAsync(CancellationToken cancellationToken)
613
return
Task
.FromCancellation<bool>(cancellationToken);
708
var waitCompleted =
Task
.WhenAny(asyncWaiter,
Task
.Delay(millisecondsTimeout, cts.Token));
system\threading\Tasks\BeginEndAwaitableAdapter.cs (1)
138
Task
.Run(continuation); // must run async at this point, or else we'd risk stack diving
system\threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (20)
148
/// <summary>Gets a <see cref="System.Threading.Tasks.
Task
"/> that will complete when the scheduler has completed processing.</summary>
149
public
Task
Completion
232
private void FaultWithTask(
Task
faultedTask)
292
Task
processingTask = null;
365
Task
exclusiveTask;
414
Task
concurrentTask;
501
internal readonly IProducerConsumerQueue<
Task
> m_tasks;
521
(IProducerConsumerQueue<
Task
>)new SingleProducerSingleConsumerQueue<
Task
>() :
522
(IProducerConsumerQueue<
Task
>)new MultiProducerMultiConsumerQueue<
Task
>();
531
protected internal override void QueueTask(
Task
task)
548
internal void ExecuteTask(
Task
task)
559
protected override bool TryExecuteTaskInline(
Task
task, bool taskWasPreviouslyQueued)
614
private bool TryExecuteTaskInlineOnTargetScheduler(
Task
task)
651
var tuple = (Tuple<ConcurrentExclusiveTaskScheduler,
Task
>)state;
658
protected override IEnumerable<
Task
> GetScheduledTasks() { return m_tasks; }
681
public IEnumerable<
Task
> ScheduledTasks { get { return m_taskScheduler.m_tasks; } }
704
public IEnumerable<
Task
> ScheduledExclusive { get { return m_pair.m_exclusiveTaskScheduler.m_tasks; } }
706
public IEnumerable<
Task
> ScheduledConcurrent { get { return m_pair.m_concurrentTaskScheduler.m_tasks; } }
system\threading\Tasks\Future.cs (48)
62
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see>
67
/// <see cref="System.Threading.Tasks.
Task
.Dispose()">Dispose</see>, are thread-safe
87
internal static readonly Func<Task<
Task
>, Task<TResult>> TaskWhenAnyCast = completed => (Task<TResult>)completed.Result;
188
: this(function,
Task
.InternalCurrentIfAttached(creationOptions), default(CancellationToken), creationOptions, InternalTaskOptions.None, null)
218
: this(function,
Task
.InternalCurrentIfAttached(creationOptions), cancellationToken, creationOptions, InternalTaskOptions.None, null)
289
: this(function, state,
Task
.InternalCurrentIfAttached(creationOptions), default(CancellationToken),
322
: this(function, state,
Task
.InternalCurrentIfAttached(creationOptions), cancellationToken,
330
Func<TResult> valueSelector,
Task
parent, CancellationToken cancellationToken,
350
internal Task(Func<TResult> valueSelector,
Task
parent, CancellationToken cancellationToken,
361
Func<object, TResult> valueSelector, object state,
Task
parent, CancellationToken cancellationToken,
380
internal Task(Delegate valueSelector, object state,
Task
parent, CancellationToken cancellationToken,
392
internal static Task<TResult> StartNew(
Task
parent, Func<TResult> function, CancellationToken cancellationToken,
417
internal static Task<TResult> StartNew(
Task
parent, Func<object, TResult> function, object state, CancellationToken cancellationToken,
725
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
727
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
735
public
Task
ContinueWith(Action<Task<TResult>> continuationAction)
750
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
752
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
763
public
Task
ContinueWith(Action<Task<TResult>> continuationAction, CancellationToken cancellationToken)
780
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
782
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
793
public
Task
ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler)
813
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
815
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
828
public
Task
ContinueWith(Action<Task<TResult>> continuationAction, TaskContinuationOptions continuationOptions)
853
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
855
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
873
public
Task
ContinueWith(Action<Task<TResult>> continuationAction, CancellationToken cancellationToken,
881
internal
Task
ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler, CancellationToken cancellationToken,
901
Task
continuationTask = new ContinuationTaskFromResultTask<TResult>(
925
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
927
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
935
public
Task
ContinueWith(Action<Task<TResult>, Object> continuationAction, Object state)
951
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
953
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
964
public
Task
ContinueWith(Action<Task<TResult>, Object> continuationAction, Object state,CancellationToken cancellationToken)
982
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
984
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
995
public
Task
ContinueWith(Action<Task<TResult>, Object> continuationAction, Object state, TaskScheduler scheduler)
1016
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
1018
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
1031
public
Task
ContinueWith(Action<Task<TResult>, Object> continuationAction, Object state,TaskContinuationOptions continuationOptions)
1057
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
1059
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
1077
public
Task
ContinueWith(Action<Task<TResult>, Object> continuationAction, Object state, CancellationToken cancellationToken,
1085
internal
Task
ContinueWith(Action<Task<TResult>, Object> continuationAction, Object state, TaskScheduler scheduler, CancellationToken cancellationToken,
1105
Task
continuationTask = new ContinuationTaskFromResultTask<TResult>(
1593
/// <returns>An IDisposable object <see cref="
Task
"/>.</returns>
system\threading\Tasks\FutureFactory.cs (79)
67
private TaskScheduler GetDefaultScheduler(
Task
currTask)
279
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
287
Task
currTask =
Task
.InternalCurrent;
308
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
316
Task
currTask =
Task
.InternalCurrent;
339
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
347
Task
currTask =
Task
.InternalCurrent;
381
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
390
Task
.InternalCurrentIfAttached(creationOptions), function, cancellationToken,
408
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
416
Task
currTask =
Task
.InternalCurrent;
439
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
447
Task
currTask =
Task
.InternalCurrent;
472
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
480
Task
currTask =
Task
.InternalCurrent;
516
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
524
return Task<TResult>.StartNew(
Task
.InternalCurrentIfAttached(creationOptions), function, state, cancellationToken,
578
if (
Task
.s_asyncDebuggingEnabled)
580
Task
.RemoveFromActiveTasks(promise.Id);
712
if (
Task
.s_asyncDebuggingEnabled)
714
Task
.AddToActiveTasks(promise);
720
Task
t = new Task(delegate
730
if (
Task
.s_asyncDebuggingEnabled)
732
Task
.AddToActiveTasks(t);
831
if (
Task
.s_asyncDebuggingEnabled)
833
Task
.AddToActiveTasks(promise);
871
if (
Task
.s_asyncDebuggingEnabled)
873
Task
.RemoveFromActiveTasks(promise.Id);
968
if (
Task
.s_asyncDebuggingEnabled)
970
Task
.AddToActiveTasks(promise);
1008
if (
Task
.s_asyncDebuggingEnabled)
1010
Task
.RemoveFromActiveTasks(promise.Id);
1113
if (
Task
.s_asyncDebuggingEnabled)
1115
Task
.AddToActiveTasks(promise);
1152
if (
Task
.s_asyncDebuggingEnabled)
1154
Task
.RemoveFromActiveTasks(promise.Id);
1265
if (
Task
.s_asyncDebuggingEnabled)
1267
Task
.AddToActiveTasks(promise);
1304
if (
Task
.s_asyncDebuggingEnabled)
1306
Task
.RemoveFromActiveTasks(promise.Id);
1470
Task
.CreationOptionsFromContinuationOptions(continuationOptions, out tco, out dontcare);
1495
public Task<TResult> ContinueWhenAll(
Task
[] tasks, Func<
Task
[], TResult> continuationFunction)
1526
public Task<TResult> ContinueWhenAll(
Task
[] tasks, Func<
Task
[], TResult> continuationFunction, CancellationToken cancellationToken)
1563
public Task<TResult> ContinueWhenAll(
Task
[] tasks, Func<
Task
[], TResult> continuationFunction, TaskContinuationOptions continuationOptions)
1610
public Task<TResult> ContinueWhenAll(
Task
[] tasks, Func<
Task
[], TResult> continuationFunction,
1818
internal static Task<TResult> ContinueWhenAllImpl(
Task
[] tasks,
1819
Func<
Task
[], TResult> continuationFunction, Action<
Task
[]> continuationAction,
1831
Task
[] tasksCopy = TaskFactory.CheckMultiContinuationTasksAndCopy(tasks);
1854
return ((Func<
Task
[], TResult>)state)(completedTasks.Result);
1868
((Action<
Task
[]>)state)(completedTasks.Result); return default(TResult);
1895
public Task<TResult> ContinueWhenAny(
Task
[] tasks, Func<
Task
, TResult> continuationFunction)
1926
public Task<TResult> ContinueWhenAny(
Task
[] tasks, Func<
Task
, TResult> continuationFunction, CancellationToken cancellationToken)
1963
public Task<TResult> ContinueWhenAny(
Task
[] tasks, Func<
Task
, TResult> continuationFunction, TaskContinuationOptions continuationOptions)
2010
public Task<TResult> ContinueWhenAny(
Task
[] tasks, Func<
Task
, TResult> continuationFunction,
2170
internal static Task<TResult> ContinueWhenAnyImpl(
Task
[] tasks,
2171
Func<
Task
, TResult> continuationFunction, Action<
Task
> continuationAction,
2185
Task<
Task
> starter = TaskFactory.CommonCWAnyLogic(tasks);
2201
(completedTask, state) => { return ((Func<
Task
, TResult>)state)(completedTask.Result); },
2210
(completedTask, state) => { ((Action<
Task
>)state)(completedTask.Result); return default(TResult); },
2267
internal static Func<Task<
Task
>, object, TResult> CWAnyFuncDelegate =
2268
(Task<
Task
> wrappedWinner, object state) =>
2276
internal static Func<Task<
Task
>, object, TResult> CWAnyActionDelegate =
2277
(Task<
Task
> wrappedWinner, object state) =>
system\threading\Tasks\Parallel.cs (19)
250
Task
callerTask = null;
254
callerTask =
Task
.InternalCurrent;
355
Task
[] tasks = new
Task
[actionsCopy.Length];
364
tasks[i] =
Task
.Factory.StartNew(actionsCopy[i], parallelOptions.CancellationToken, TaskCreationOptions.None,
380
Task
.FastWaitAll(tasks);
385
Task
.WaitAll(tasks);
1096
Task
callingTask = null;
1100
callingTask =
Task
.InternalCurrent;
1126
Task
currentWorkerTask =
Task
.InternalCurrent;
1410
Task
callerTask = null;
1415
callerTask =
Task
.InternalCurrent;
1440
Task
currentWorkerTask =
Task
.InternalCurrent;
3225
Task
callerTask = null;
3229
callerTask =
Task
.InternalCurrent;
3286
Task
currentWorkerTask =
Task
.InternalCurrent;
system\threading\Tasks\Task.cs (399)
52
/// Represents the current stage in the lifecycle of a <see cref="
Task
"/>.
102
/// <see cref="
Task
"/> instances may be created in a variety of ways. The most common approach is by
105
/// purposes. For example, to create a <see cref="
Task
"/> that runs an action, the factory's StartNew
116
/// The <see cref="
Task
"/> class also provides constructors that initialize the Task but that do not
123
/// All members of <see cref="
Task
"/>, except for <see cref="Dispose()"/>, are thread-safe
149
internal static
Task
t_currentTask; // The currently executing task.
170
internal readonly
Task
m_parent; // A task's parent, or null if parent-less.
222
private static readonly Dictionary<int,
Task
> s_currentActiveTasks = new Dictionary<int,
Task
>();
228
internal static bool AddToActiveTasks(
Task
task)
278
internal volatile List<
Task
> m_exceptionalChildren;
365
m_parent =
Task
.InternalCurrent;
371
/// Initializes a new <see cref="
Task
"/> with the specified action.
384
/// Initializes a new <see cref="
Task
"/> with the specified action and <see cref="System.Threading.CancellationToken">CancellationToken</see>.
402
/// Initializes a new <see cref="
Task
"/> with the specified action and creation options.
418
: this(action, null,
Task
.InternalCurrentIfAttached(creationOptions), default(CancellationToken), creationOptions, InternalTaskOptions.None, null)
425
/// Initializes a new <see cref="
Task
"/> with the specified action and creation options.
445
: this(action, null,
Task
.InternalCurrentIfAttached(creationOptions), cancellationToken, creationOptions, InternalTaskOptions.None, null)
453
/// Initializes a new <see cref="
Task
"/> with the specified action and state.
469
/// Initializes a new <see cref="
Task
"/> with the specified action, state, snd options.
489
/// Initializes a new <see cref="
Task
"/> with the specified action, state, snd options.
506
: this(action, state,
Task
.InternalCurrentIfAttached(creationOptions), default(CancellationToken), creationOptions, InternalTaskOptions.None, null)
513
/// Initializes a new <see cref="
Task
"/> with the specified action, state, snd options.
534
: this(action, state,
Task
.InternalCurrentIfAttached(creationOptions), cancellationToken, creationOptions, InternalTaskOptions.None, null)
540
internal Task(Action<object> action, object state,
Task
parent, CancellationToken cancellationToken,
558
internal Task(Delegate action, object state,
Task
parent, CancellationToken cancellationToken,
670
private void AssignCancellationToken(CancellationToken cancellationToken,
Task
antecedent, TaskContinuation continuation)
711
new Tuple<
Task
,
Task
, TaskContinuation>(this, antecedent, continuation));
738
var
targetTask = o as
Task
;
741
var tuple = o as Tuple<
Task
,
Task
, TaskContinuation>;
746
Task
antecedentTask = tuple.Item2;
896
internal static bool AnyTaskRequiresNotifyDebuggerOfWaitCompletion(
Task
[] tasks)
899
foreach (
var
task in tasks)
918
return (m_stateFlags & (
Task
.TASK_STATE_WAIT_COMPLETION_NOTIFICATION |
Task
.TASK_STATE_RAN_TO_COMPLETION))
919
!=
Task
.TASK_STATE_RAN_TO_COMPLETION;
978
if (etwLog.IsEnabled() && (m_stateFlags &
Task
.TASK_STATE_TASKSCHEDULED_WAS_FIRED) == 0)
980
m_stateFlags |=
Task
.TASK_STATE_TASKSCHEDULED_WAS_FIRED;
982
Task
currentTask =
Task
.InternalCurrent;
983
Task
parentTask = this.m_parent;
1003
Contract.Assert(
Task
.InternalCurrent == this || this.IsSelfReplicatingRoot, "Task.AddNewChild(): Called from an external context");
1026
Contract.Assert(
Task
.InternalCurrent == this, "Task.DisregardChild(): Called from an external context");
1034
/// Starts the <see cref="
Task
"/>, scheduling it for execution to the current <see
1042
/// The <see cref="
Task
"/> is not in a valid state to be started. It may have already been started,
1052
/// Starts the <see cref="
Task
"/>, scheduling it for execution to the specified <see
1067
/// The <see cref="
Task
"/> is not in a valid state to be started. It may have already been started,
1108
/// Runs the <see cref="
Task
"/> synchronously on the current <see
1127
/// The <see cref="
Task
"/> is not in a valid state to be started. It may have already been started,
1137
/// Runs the <see cref="
Task
"/> synchronously on the <see
1152
/// The <see cref="
Task
"/> is not in a valid state to be started. It may have already been started,
1277
internal static
Task
InternalStartNew(
1278
Task
creatingTask, Delegate action, object state, CancellationToken cancellationToken, TaskScheduler scheduler,
1290
Task
t = new Task(action, state, creatingTask, cancellationToken, options, internalOptions | InternalTaskOptions.QueuedByRuntime, scheduler);
1298
/// Gets a unique ID for a <see cref="
Task
">Task</see> or task continuation instance.
1319
/// Gets a unique ID for this <see cref="
Task
">Task</see> instance.
1340
/// Returns the unique ID of the currently executing <see cref="
Task
">Task</see>.
1346
Task
currentTask = InternalCurrent;
1355
/// Gets the <see cref="
Task
">Task</see> instance currently executing, or
1358
internal static
Task
InternalCurrent
1369
internal static
Task
InternalCurrentIfAttached(TaskCreationOptions creationOptions)
1393
/// cref="
Task
">Task</see> to end prematurely. If the <see
1394
/// cref="
Task
">Task</see> completed successfully or has not yet thrown any
1449
/// Gets whether this <see cref="
Task
">Task</see> instance has completed
1453
/// A <see cref="
Task
">Task</see> will complete in Canceled state either if its <see cref="CancellationToken">CancellationToken</see>
1531
/// Gets whether this <see cref="
Task
"/> threw an OperationCanceledException while its CancellationToken was signaled.
1540
/// Gets whether this <see cref="
Task
">Task</see> has completed.
1589
/// The <see cref="
Task
"/> has been disposed.
1607
/// Gets the state object supplied when the <see cref="
Task
">Task</see> was created,
1636
/// Provides access to factory methods for creating <see cref="
Task
"/> and <see cref="Task{TResult}"/> instances.
1646
private static
Task
s_completedTask;
1650
public static
Task
CompletedTask
1654
var
completedTask = s_completedTask;
1734
/// Gets whether the <see cref="
Task
"/> completed due to an unhandled exception.
1816
/// Disposes the <see cref="
Task
"/>, releasing all of its unmanaged resources.
1819
/// Unlike most of the members of <see cref="
Task
"/>, this method is not thread-safe.
1820
/// Also, <see cref="Dispose()"/> may only be called on a <see cref="
Task
"/> that is in one of
1826
/// The exception that is thrown if the <see cref="
Task
"/> is not in
1838
/// Disposes the <see cref="
Task
"/>, releasing all of its unmanaged resources.
1845
/// Unlike most of the members of <see cref="
Task
"/>, this method is not thread-safe.
2173
&&
Task
.InternalCurrent == m_parent)
2253
List<
Task
> exceptionalChildren = props != null ? props.m_exceptionalChildren : null;
2266
private readonly static Predicate<
Task
> s_IsExceptionObservedByParentPredicate = new Predicate<
Task
>((t) => { return t.IsExceptionObservedByParent; });
2286
if (
Task
.s_asyncDebuggingEnabled)
2304
if (
Task
.s_asyncDebuggingEnabled)
2315
if (
Task
.s_asyncDebuggingEnabled)
2368
internal void ProcessChildCompletion(
Task
childTask)
2383
Interlocked.CompareExchange(ref props.m_exceptionalChildren, new List<
Task
>(), null);
2390
List<
Task
> tmp = props.m_exceptionalChildren;
2421
List<
Task
> tmp = (props != null) ? props.m_exceptionalChildren : null;
2429
foreach (
Task
task in tmp)
2532
internal virtual
Task
CreateReplicaTask(Action<object> taskReplicaDelegate, Object stateObject,
Task
parentTask, TaskScheduler taskScheduler,
2557
internal virtual
Task
HandedOverChildReplica
2564
private static void ExecuteSelfReplicating(
Task
root)
2584
Task
currentTask =
Task
.InternalCurrent;
2588
Task
childTask = currentTask.HandedOverChildReplica;
2647
Task
replacementReplica = root.CreateReplicaTask(taskReplicaDelegate, root.m_stateObject, root, root.ExecutingTaskScheduler,
2772
private void ExecuteWithThreadLocal(ref
Task
currentTaskSlot)
2775
Task
previousTask = currentTaskSlot;
2858
Task
task = obj as
Task
;
2896
internal void InnerInvokeWithArg(
Task
childTask)
2932
/// <summary>Gets an awaiter used to await this <see cref="System.Threading.Tasks.
Task
"/>.</summary>
2940
/// <summary>Configures an awaiter used to await this <see cref="System.Threading.Tasks.
Task
"/>.</summary>
2951
/// Sets a continuation onto the <see cref="System.Threading.Tasks.
Task
"/>.
2955
/// <param name="continuationAction">The action to invoke when the <see cref="System.Threading.Tasks.
Task
"/> has completed.</param>
3038
/// Waits for the <see cref="
Task
"/> to complete execution.
3041
/// The <see cref="
Task
"/> was canceled -or- an exception was thrown during
3042
/// the execution of the <see cref="
Task
"/>.
3057
/// Waits for the <see cref="
Task
"/> to complete execution.
3064
/// true if the <see cref="
Task
"/> completed execution within the allotted time; otherwise, false.
3067
/// The <see cref="
Task
"/> was canceled -or- an exception was thrown during the execution of the <see
3068
/// cref="
Task
"/>.
3088
/// Waits for the <see cref="
Task
"/> to complete execution.
3097
/// The <see cref="
Task
"/> was canceled -or- an exception was thrown during the execution of the <see
3098
/// cref="
Task
"/>.
3107
/// Waits for the <see cref="
Task
"/> to complete execution.
3112
/// <returns>true if the <see cref="
Task
"/> completed execution within the allotted time; otherwise,
3120
/// The <see cref="
Task
"/> was canceled -or- an exception was thrown during the execution of the <see
3121
/// cref="
Task
"/>.
3130
/// Waits for the <see cref="
Task
"/> to complete execution.
3140
/// true if the <see cref="
Task
"/> completed execution within the allotted time; otherwise, false.
3143
/// The <see cref="
Task
"/> was canceled -or- an exception was thrown during the execution of the <see
3144
/// cref="
Task
"/>.
3231
Task
currentTask =
Task
.InternalCurrent;
3268
Task
currentTask =
Task
.InternalCurrent;
3297
public void Invoke(
Task
completingTask) { Set(); }
3382
/// Cancels the <see cref="
Task
"/>.
3560
if (
Task
.s_asyncDebuggingEnabled)
3575
Contract.Assert(this ==
Task
.InternalCurrent, "SetCancellationAcknowledged() should only be called while this is still the current task");
3736
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
3739
/// An action to run when the <see cref="
Task
"/> completes. When run, the delegate will be
3742
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
3744
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
3752
public
Task
ContinueWith(Action<
Task
> continuationAction)
3759
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
3762
/// An action to run when the <see cref="
Task
"/> completes. When run, the delegate will be
3766
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
3768
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
3779
public
Task
ContinueWith(Action<
Task
> continuationAction, CancellationToken cancellationToken)
3786
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
3789
/// An action to run when the <see cref="
Task
"/> completes. When run, the delegate will be
3795
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
3797
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
3808
public
Task
ContinueWith(Action<
Task
> continuationAction, TaskScheduler scheduler)
3815
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
3818
/// An action to run when the <see cref="
Task
"/> completes. When run, the delegate will be
3828
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
3830
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
3843
public
Task
ContinueWith(Action<
Task
> continuationAction, TaskContinuationOptions continuationOptions)
3850
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
3853
/// An action to run when the <see cref="
Task
"/> completes. When run, the delegate will be
3868
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
3870
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
3888
public
Task
ContinueWith(Action<
Task
> continuationAction, CancellationToken cancellationToken,
3896
private
Task
ContinueWith(Action<
Task
> continuationAction, TaskScheduler scheduler,
3916
Task
continuationTask = new ContinuationTaskFromTask(
3933
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
3936
/// An action to run when the <see cref="
Task
"/> completes. When run, the delegate will be
3940
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
3942
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
3950
public
Task
ContinueWith(Action<
Task
, Object> continuationAction, Object state)
3957
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
3960
/// An action to run when the <see cref="
Task
"/> completes. When run, the delegate will be
3965
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
3967
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
3978
public
Task
ContinueWith(Action<
Task
, Object> continuationAction, Object state, CancellationToken cancellationToken)
3985
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
3988
/// An action to run when the <see cref="
Task
"/> completes. When run, the delegate will be
3995
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
3997
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
4008
public
Task
ContinueWith(Action<
Task
, Object> continuationAction, Object state, TaskScheduler scheduler)
4015
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
4018
/// An action to run when the <see cref="
Task
"/> completes. When run, the delegate will be
4029
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
4031
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
4044
public
Task
ContinueWith(Action<
Task
, Object> continuationAction, Object state, TaskContinuationOptions continuationOptions)
4051
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
4054
/// An action to run when the <see cref="
Task
"/> completes. When run, the delegate will be
4070
/// <returns>A new continuation <see cref="
Task
"/>.</returns>
4072
/// The returned <see cref="
Task
"/> will not be scheduled for execution until the current task has
4090
public
Task
ContinueWith(Action<
Task
, Object> continuationAction, Object state, CancellationToken cancellationToken,
4098
private
Task
ContinueWith(Action<
Task
, Object> continuationAction, Object state, TaskScheduler scheduler,
4118
Task
continuationTask = new ContinuationTaskFromTask(
4136
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
4142
/// A function to run when the <see cref="
Task
"/> completes. When run, the delegate will be
4155
public Task<TResult> ContinueWith<TResult>(Func<
Task
, TResult> continuationFunction)
4164
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
4170
/// A function to run when the <see cref="
Task
"/> completes. When run, the delegate will be
4187
public Task<TResult> ContinueWith<TResult>(Func<
Task
, TResult> continuationFunction, CancellationToken cancellationToken)
4194
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
4200
/// A function to run when the <see cref="
Task
"/> completes. When run, the delegate will be
4219
public Task<TResult> ContinueWith<TResult>(Func<
Task
, TResult> continuationFunction, TaskScheduler scheduler)
4226
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
4232
/// A function to run when the <see cref="
Task
"/> completes. When run, the delegate will be
4257
public Task<TResult> ContinueWith<TResult>(Func<
Task
, TResult> continuationFunction, TaskContinuationOptions continuationOptions)
4264
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
4270
/// A function to run when the <see cref="
Task
"/> completes. When run, the delegate will be
4305
public Task<TResult> ContinueWith<TResult>(Func<
Task
, TResult> continuationFunction, CancellationToken cancellationToken,
4313
private Task<TResult> ContinueWith<TResult>(Func<
Task
, TResult> continuationFunction, TaskScheduler scheduler,
4350
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
4356
/// A function to run when the <see cref="
Task
"/> completes. When run, the delegate will be
4370
public Task<TResult> ContinueWith<TResult>(Func<
Task
, Object, TResult> continuationFunction, Object state)
4379
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
4385
/// A function to run when the <see cref="
Task
"/> completes. When run, the delegate will be
4403
public Task<TResult> ContinueWith<TResult>(Func<
Task
, Object, TResult> continuationFunction, Object state, CancellationToken cancellationToken)
4410
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
4416
/// A function to run when the <see cref="
Task
"/> completes. When run, the delegate will be
4436
public Task<TResult> ContinueWith<TResult>(Func<
Task
, Object, TResult> continuationFunction, Object state, TaskScheduler scheduler)
4443
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
4449
/// A function to run when the <see cref="
Task
"/> completes. When run, the delegate will be
4475
public Task<TResult> ContinueWith<TResult>(Func<
Task
, Object, TResult> continuationFunction, Object state, TaskContinuationOptions continuationOptions)
4482
/// Creates a continuation that executes when the target <see cref="
Task
"/> completes.
4488
/// A function to run when the <see cref="
Task
"/> completes. When run, the delegate will be
4524
public Task<TResult> ContinueWith<TResult>(Func<
Task
, Object, TResult> continuationFunction, Object state, CancellationToken cancellationToken,
4532
private Task<TResult> ContinueWith<TResult>(Func<
Task
, Object, TResult> continuationFunction, Object state, TaskScheduler scheduler,
4631
internal void ContinueWithCore(
Task
continuationTask,
4694
etwLog.AwaitTaskContinuationScheduled(TaskScheduler.Current.Id,
Task
.CurrentId ?? 0, continuationTask.Id);
4872
/// Waits for all of the provided <see cref="
Task
"/> objects to complete execution.
4875
/// An array of <see cref="
Task
"/> instances on which to wait.
4884
/// At least one of the <see cref="
Task
"/> instances was canceled -or- an exception was thrown during
4885
/// the execution of at least one of the <see cref="
Task
"/> instances.
4888
public static void WaitAll(params
Task
[] tasks)
4901
/// Waits for all of the provided <see cref="
Task
"/> objects to complete execution.
4904
/// true if all of the <see cref="
Task
"/> instances completed execution within the allotted time;
4908
/// An array of <see cref="
Task
"/> instances on which to wait.
4921
/// At least one of the <see cref="
Task
"/> instances was canceled -or- an exception was thrown during
4922
/// the execution of at least one of the <see cref="
Task
"/> instances.
4930
public static bool WaitAll(
Task
[] tasks, TimeSpan timeout)
4943
/// Waits for all of the provided <see cref="
Task
"/> objects to complete execution.
4946
/// true if all of the <see cref="
Task
"/> instances completed execution within the allotted time;
4952
/// <param name="tasks">An array of <see cref="
Task
"/> instances on which to wait.
4961
/// At least one of the <see cref="
Task
"/> instances was canceled -or- an exception was thrown during
4962
/// the execution of at least one of the <see cref="
Task
"/> instances.
4969
public static bool WaitAll(
Task
[] tasks, int millisecondsTimeout)
4975
/// Waits for all of the provided <see cref="
Task
"/> objects to complete execution.
4978
/// true if all of the <see cref="
Task
"/> instances completed execution within the allotted time;
4982
/// An array of <see cref="
Task
"/> instances on which to wait.
4994
/// At least one of the <see cref="
Task
"/> instances was canceled -or- an exception was thrown during
4995
/// the execution of at least one of the <see cref="
Task
"/> instances.
5001
public static void WaitAll(
Task
[] tasks, CancellationToken cancellationToken)
5007
/// Waits for all of the provided <see cref="
Task
"/> objects to complete execution.
5010
/// true if all of the <see cref="
Task
"/> instances completed execution within the allotted time;
5014
/// An array of <see cref="
Task
"/> instances on which to wait.
5030
/// At least one of the <see cref="
Task
"/> instances was canceled -or- an exception was thrown during
5031
/// the execution of at least one of the <see cref="
Task
"/> instances.
5041
public static bool WaitAll(
Task
[] tasks, int millisecondsTimeout, CancellationToken cancellationToken)
5062
List<
Task
> waitedOnTaskList = null;
5063
List<
Task
> notificationTasks = null;
5073
Task
task = tasks[i];
5117
foreach (
var
task in waitedOnTaskList)
5139
foreach (
var
task in notificationTasks)
5156
foreach (
var
task in tasks) AddExceptionsForCompletedTask(ref exceptions, task);
5180
private static bool WaitAllBlockingCore(List<
Task
> tasks, int millisecondsTimeout, CancellationToken cancellationToken)
5189
foreach (
var
task in tasks)
5199
foreach (
var
task in tasks)
5233
public void Invoke(
Task
completingTask)
5244
internal static void FastWaitAll(
Task
[] tasks)
5266
var
task = tasks[i];
5288
internal static void AddExceptionsForCompletedTask(ref List<Exception> exceptions,
Task
t)
5309
/// Waits for any of the provided <see cref="
Task
"/> objects to complete execution.
5312
/// An array of <see cref="
Task
"/> instances on which to wait.
5322
public static int WaitAny(params
Task
[] tasks)
5330
/// Waits for any of the provided <see cref="
Task
"/> objects to complete execution.
5333
/// An array of <see cref="
Task
"/> instances on which to wait.
5355
public static int WaitAny(
Task
[] tasks, TimeSpan timeout)
5367
/// Waits for any of the provided <see cref="
Task
"/> objects to complete execution.
5370
/// An array of <see cref="
Task
"/> instances on which to wait.
5388
public static int WaitAny(
Task
[] tasks, CancellationToken cancellationToken)
5394
/// Waits for any of the provided <see cref="
Task
"/> objects to complete execution.
5397
/// An array of <see cref="
Task
"/> instances on which to wait.
5418
public static int WaitAny(
Task
[] tasks, int millisecondsTimeout)
5424
/// Waits for any of the provided <see cref="
Task
"/> objects to complete execution.
5427
/// An array of <see cref="
Task
"/> instances on which to wait.
5454
public static int WaitAny(
Task
[] tasks, int millisecondsTimeout, CancellationToken cancellationToken)
5475
Task
task = tasks[taskIndex];
5492
Task<
Task
> firstCompleted = TaskFactory.CommonCWAnyLogic(tasks);
5526
public static
Task
FromException(Exception exception)
5546
/// <summary>Creates a <see cref="
Task
"/> that's completed due to cancellation with the specified token.</summary>
5550
internal static
Task
FromCancellation(CancellationToken cancellationToken)
5557
/// <summary>Creates a <see cref="
Task
"/> that's completed due to cancellation with the specified token.</summary>
5560
public static
Task
FromCanceled(CancellationToken cancellationToken)
5614
public static
Task
Run(Action action)
5617
return
Task
.InternalStartNew(null, action, null, default(CancellationToken), TaskScheduler.Default,
5634
public static
Task
Run(Action action, CancellationToken cancellationToken)
5637
return
Task
.InternalStartNew(null, action, null, cancellationToken, TaskScheduler.Default,
5686
public static
Task
Run(Func<
Task
> function)
5705
public static
Task
Run(Func<
Task
> function, CancellationToken cancellationToken)
5718
return
Task
.FromCancellation(cancellationToken);
5721
Task<
Task
> task1 = Task<
Task
>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
5769
return
Task
.FromCancellation<TResult>(cancellationToken);
5797
public static
Task
Delay(TimeSpan delay)
5819
public static
Task
Delay(TimeSpan delay, CancellationToken cancellationToken)
5841
public static
Task
Delay(int millisecondsDelay)
5863
public static
Task
Delay(int millisecondsDelay, CancellationToken cancellationToken)
5876
return
Task
.FromCancellation(cancellationToken);
5881
return
Task
.CompletedTask;
5914
if (
Task
.s_asyncDebuggingEnabled)
5938
if (
Task
.s_asyncDebuggingEnabled)
5983
public static
Task
WhenAll(IEnumerable<
Task
> tasks)
5986
Task
[] taskArray = tasks as
Task
[];
5993
ICollection<
Task
> taskCollection = tasks as ICollection<
Task
>;
5997
taskArray = new
Task
[taskCollection.Count];
5998
foreach (
var
task in tasks)
6008
List<
Task
> taskList = new List<
Task
>();
6009
foreach (
Task
task in tasks)
6046
public static
Task
WhenAll(params
Task
[] tasks)
6055
Task
[] tasksCopy = new
Task
[taskCount];
6058
Task
task = tasks[i];
6069
private static
Task
InternalWhenAll(
Task
[] tasks)
6073
Task
.CompletedTask :
6095
private readonly
Task
[] m_tasks;
6099
internal WhenAllPromise(
Task
[] tasks) :
6116
foreach (
var
task in tasks)
6123
public void Invoke(
Task
completedTask)
6133
Task
canceledTask = null;
6141
var
task = m_tasks[i];
6177
if (
Task
.s_asyncDebuggingEnabled)
6197
Task
.AnyTaskRequiresNotifyDebuggerOfWaitCompletion(m_tasks);
6367
public void Invoke(
Task
ignored)
6378
Task
canceledTask = null;
6427
if (
Task
.s_asyncDebuggingEnabled)
6447
Task
.AnyTaskRequiresNotifyDebuggerOfWaitCompletion(m_tasks);
6469
public static Task<
Task
> WhenAny(params
Task
[] tasks)
6481
Task
[] tasksCopy = new
Task
[taskCount];
6484
Task
task = tasks[i];
6508
public static Task<
Task
> WhenAny(IEnumerable<
Task
> tasks)
6515
List<
Task
> taskList = new List<
Task
>();
6516
foreach (
Task
task in tasks)
6553
Task<
Task
> intermediate = WhenAny((
Task
[])tasks);
6582
Task<
Task
> intermediate = WhenAny((IEnumerable<
Task
>)tasks);
6591
internal static Task<TResult> CreateUnwrapPromise<TResult>(
Task
outerTask, bool lookForOce)
6623
Task
continuationTask = continuationObject as
Task
;
6637
return new Delegate[] { new Action<
Task
>(singleCompletionAction.Invoke) };
6664
private static
Task
GetActiveTaskFromId(int taskId)
6666
Task
task = null;
6671
private static
Task
[] GetActiveTasks()
6674
return new List<
Task
>(s_currentActiveTasks.Values).ToArray();
6683
private readonly
Task
m_completingTask;
6685
internal CompletionActionInvoker(ITaskCompletionAction action,
Task
completingTask)
6707
private
Task
m_task;
6709
public SystemThreadingTasks_TaskDebugView(
Task
task)
6737
: base(action, null,
Task
.InternalCurrent, default(CancellationToken), creationOptions, internalOptions | InternalTaskOptions.SelfReplicating, null)
6765
internal override
Task
CreateReplicaTask(Action<object> taskReplicaDelegate, Object stateObject,
Task
parentTask, TaskScheduler taskScheduler,
6783
internal
Task
m_handedOverChildReplica; // some replicas may quit prematurely, in which case they will use this variable
6786
internal ParallelForReplicaTask(Action<object> taskReplicaDelegate, Object stateObject,
Task
parentTask, TaskScheduler taskScheduler,
6810
internal override
Task
HandedOverChildReplica
7129
void Invoke(
Task
completingTask);
7149
public UnwrapPromise(
Task
outerTask, bool lookForOce)
7159
if (
Task
.s_asyncDebuggingEnabled)
7178
public void Invoke(
Task
completingTask)
7182
var sg =
Task
.CurrentStackGuard;
7199
private void InvokeCore(
Task
completingTask)
7220
private void InvokeCoreAsync(
Task
completingTask)
7229
var tuple = (Tuple<UnwrapPromise<TResult>,
Task
>)state;
7231
}, Tuple.Create<UnwrapPromise<TResult>,
Task
>(this, completingTask));
7236
private void ProcessCompletedOuterTask(
Task
task)
7258
taskOfTaskOfTResult.Result : ((Task<
Task
>)task).Result);
7267
private bool TrySetFromTask(
Task
task, bool lookForOce)
7303
if (
Task
.s_asyncDebuggingEnabled)
7319
private void ProcessInnerTask(
Task
task)
system\threading\Tasks\TaskCanceledException.cs (3)
31
private
Task
m_canceledTask; // The task which has been canceled.
65
public TaskCanceledException(
Task
task) :
89
public
Task
Task
system\threading\Tasks\TaskContinuation.cs (46)
31
private
Task
m_antecedent;
34
Task
antecedent, Delegate action, object state, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, ref StackCrawlMark stackMark) :
35
base(action, state,
Task
.InternalCurrentIfAttached(creationOptions), default(CancellationToken), creationOptions, internalOptions, null)
37
Contract.Requires(action is Action<
Task
> || action is Action<
Task
, object>,
50
var
antecedent = m_antecedent;
60
var action = m_action as Action<
Task
>;
66
var actionWithState = m_action as Action<
Task
, object>;
79
private
Task
m_antecedent;
82
Task
antecedent, Delegate function, object state, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, ref StackCrawlMark stackMark) :
83
base(function, state,
Task
.InternalCurrentIfAttached(creationOptions), default(CancellationToken), creationOptions, internalOptions, null)
85
Contract.Requires(function is Func<
Task
, TResult> || function is Func<
Task
, object, TResult>,
98
var
antecedent = m_antecedent;
108
var func = m_action as Func<
Task
, TResult>;
114
var funcWithState = m_action as Func<
Task
, object, TResult>;
131
base(action, state,
Task
.InternalCurrentIfAttached(creationOptions), default(CancellationToken), creationOptions, internalOptions, null)
179
base(function, state,
Task
.InternalCurrentIfAttached(creationOptions), default(CancellationToken), creationOptions, internalOptions, null)
234
internal abstract void Run(
Task
completedTask, bool bCanInlineContinuationTask);
242
protected static void InlineIfPossibleOrElseQueue(
Task
task, bool needsProtection)
257
task.m_stateFlags |=
Task
.TASK_STATE_STARTED;
274
(task.m_stateFlags &
Task
.TASK_STATE_THREAD_WAS_ABORTED) != 0)) // this ensures TAEs from QueueTask will be wrapped in TSE
293
internal readonly
Task
m_task;
303
internal StandardTaskContinuation(
Task
task, TaskContinuationOptions options, TaskScheduler scheduler)
313
if (
Task
.s_asyncDebuggingEnabled)
315
Task
.AddToActiveTasks(m_task);
322
internal override void Run(
Task
completedTask, bool bCanInlineContinuationTask)
338
Task
continuationTask = m_task;
413
internal sealed override void Run(
Task
task, bool canInlineContinuationTask)
419
RunCallback(GetInvokeActionCallback(), m_action, ref
Task
.t_currentTask);
427
m_continuationId =
Task
.NewId();
430
RunCallback(GetPostActionCallback(), this, ref
Task
.t_currentTask);
503
internal sealed override void Run(
Task
ignored, bool canInlineContinuationTask)
523
var
task = CreateTask(state => {
588
protected
Task
CreateTask(Action<object> action, object state, TaskScheduler scheduler)
605
internal override void Run(
Task
task, bool canInlineContinuationTask)
614
RunCallback(GetInvokeActionCallback(), m_action, ref
Task
.t_currentTask); // any exceptions from m_action will be handled by s_callbackRunAction
621
m_continuationId =
Task
.NewId();
746
protected void RunCallback(ContextCallback callback, object state, ref
Task
currentTask)
749
Contract.Assert(currentTask ==
Task
.t_currentTask);
753
var
prevCurrentTask = currentTask;
794
internal static void RunOrScheduleAction(Action action, bool allowInlining, ref
Task
currentTask)
796
Contract.Assert(currentTask ==
Task
.t_currentTask);
806
Task
prevCurrentTask = currentTask;
825
internal static void UnsafeScheduleAction(Action action,
Task
task)
832
atc.m_continuationId =
Task
.NewId();
system\threading\Tasks\TaskExceptionHolder.cs (2)
46
private readonly
Task
m_task;
61
internal TaskExceptionHolder(
Task
task)
system\threading\Tasks\TaskFactory.cs (156)
40
/// <see cref="System.Threading.Tasks.
Task
.Factory">Task.Factory</see> property.
63
private TaskScheduler GetDefaultScheduler(
Task
currTask)
295
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution. However,
300
public
Task
StartNew(Action action)
303
Task
currTask =
Task
.InternalCurrent;
304
return
Task
.InternalStartNew(currTask, action, null, m_defaultCancellationToken, GetDefaultScheduler(currTask),
322
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution. However,
327
public
Task
StartNew(Action action, CancellationToken cancellationToken)
330
Task
currTask =
Task
.InternalCurrent;
331
return
Task
.InternalStartNew(currTask, action, null, cancellationToken, GetDefaultScheduler(currTask),
352
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
357
public
Task
StartNew(Action action, TaskCreationOptions creationOptions)
360
Task
currTask =
Task
.InternalCurrent;
361
return
Task
.InternalStartNew(currTask, action, null, m_defaultCancellationToken, GetDefaultScheduler(currTask), creationOptions,
369
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that will be assigned to the new <see cref="
Task
"/></param>
393
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
398
public
Task
StartNew(Action action, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler)
401
return
Task
.InternalStartNew(
402
Task
.InternalCurrentIfAttached(creationOptions), action, null, cancellationToken, scheduler, creationOptions,
408
internal
Task
StartNew(Action action, CancellationToken cancellationToken, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler)
411
return
Task
.InternalStartNew(
412
Task
.InternalCurrentIfAttached(creationOptions), action, null, cancellationToken, scheduler, creationOptions, internalOptions, ref stackMark);
429
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
434
public
Task
StartNew(Action<Object> action, Object state)
437
Task
currTask =
Task
.InternalCurrent;
438
return
Task
.InternalStartNew(currTask, action, state, m_defaultCancellationToken, GetDefaultScheduler(currTask),
449
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that will be assigned to the new <see cref="
Task
"/></param>
460
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
465
public
Task
StartNew(Action<Object> action, Object state, CancellationToken cancellationToken)
468
Task
currTask =
Task
.InternalCurrent;
469
return
Task
.InternalStartNew(currTask, action, state, cancellationToken, GetDefaultScheduler(currTask),
492
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
497
public
Task
StartNew(Action<Object> action, Object state, TaskCreationOptions creationOptions)
500
Task
currTask =
Task
.InternalCurrent;
501
return
Task
.InternalStartNew(currTask, action, state, m_defaultCancellationToken, GetDefaultScheduler(currTask),
535
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
540
public
Task
StartNew(Action<Object> action, Object state, CancellationToken cancellationToken,
544
return
Task
.InternalStartNew(
545
Task
.InternalCurrentIfAttached(creationOptions), action, state, cancellationToken, scheduler,
564
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
572
Task
currTask =
Task
.InternalCurrent;
586
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that will be assigned to the new <see cref="
Task
"/></param>
597
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
605
Task
currTask =
Task
.InternalCurrent;
631
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
639
Task
currTask =
Task
.InternalCurrent;
676
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
685
Task
.InternalCurrentIfAttached(creationOptions), function, cancellationToken,
706
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
714
Task
currTask =
Task
.InternalCurrent;
730
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that will be assigned to the new <see cref="
Task
"/></param>
741
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
749
Task
currTask =
Task
.InternalCurrent;
777
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
785
Task
currTask =
Task
.InternalCurrent;
824
/// <see cref="System.Threading.Tasks.
Task
.Start()">Start</see> to schedule it for execution.
834
Task
.InternalCurrentIfAttached(creationOptions), function, state, cancellationToken,
857
public
Task
FromAsync(
885
public
Task
FromAsync(
918
public
Task
FromAsync(
929
private
Task
FromAsync(
956
public
Task
FromAsync(
986
public
Task
FromAsync(
1015
public
Task
FromAsync<TArg1>(
1051
public
Task
FromAsync<TArg1>(
1085
public
Task
FromAsync<TArg1, TArg2>(
1124
public
Task
FromAsync<TArg1, TArg2>(
1162
public
Task
FromAsync<TArg1, TArg2, TArg3>(
1205
public
Task
FromAsync<TArg1, TArg2, TArg3>(
1634
private sealed class CompleteOnCountdownPromise : Task<
Task
[]>, ITaskCompletionAction
1636
private readonly
Task
[] _tasks;
1639
internal CompleteOnCountdownPromise(
Task
[] tasksCopy) : base()
1648
if (
Task
.s_asyncDebuggingEnabled)
1654
public void Invoke(
Task
completingTask)
1665
if (
Task
.s_asyncDebuggingEnabled)
1685
Task
.AnyTaskRequiresNotifyDebuggerOfWaitCompletion(_tasks);
1691
internal static Task<
Task
[]> CommonCWAllLogic(
Task
[] tasksCopy)
1726
if (
Task
.s_asyncDebuggingEnabled)
1732
public void Invoke(
Task
completingTask)
1743
if (
Task
.s_asyncDebuggingEnabled)
1763
Task
.AnyTaskRequiresNotifyDebuggerOfWaitCompletion(_tasks);
1801
public
Task
ContinueWhenAll(
Task
[] tasks, Action<
Task
[]> continuationAction)
1833
public
Task
ContinueWhenAll(
Task
[] tasks, Action<
Task
[]> continuationAction, CancellationToken cancellationToken)
1870
public
Task
ContinueWhenAll(
Task
[] tasks, Action<
Task
[]> continuationAction, TaskContinuationOptions continuationOptions)
1917
public
Task
ContinueWhenAll(
Task
[] tasks, Action<
Task
[]> continuationAction, CancellationToken cancellationToken,
1945
public
Task
ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction)
1978
public
Task
ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction,
2017
public
Task
ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction,
2066
public
Task
ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction,
2097
public Task<TResult> ContinueWhenAll<TResult>(
Task
[] tasks, Func<
Task
[], TResult> continuationFunction)
2133
public Task<TResult> ContinueWhenAll<TResult>(
Task
[] tasks, Func<
Task
[], TResult> continuationFunction, CancellationToken cancellationToken)
2174
public Task<TResult> ContinueWhenAll<TResult>(
Task
[] tasks, Func<
Task
[], TResult> continuationFunction, TaskContinuationOptions continuationOptions)
2225
public Task<TResult> ContinueWhenAll<TResult>(
Task
[] tasks, Func<
Task
[], TResult> continuationFunction, CancellationToken cancellationToken,
2415
internal sealed class CompleteOnInvokePromise : Task<
Task
>, ITaskCompletionAction
2417
private IList<
Task
> _tasks; // must track this for cleanup
2420
public CompleteOnInvokePromise(IList<
Task
> tasks) : base()
2428
if (
Task
.s_asyncDebuggingEnabled)
2434
public void Invoke(
Task
completingTask)
2444
if (
Task
.s_asyncDebuggingEnabled)
2461
var
task = tasks[i];
2475
internal static Task<
Task
> CommonCWAnyLogic(IList<
Task
> tasks)
2488
var
task = tasks[i];
2545
public
Task
ContinueWhenAny(
Task
[] tasks, Action<
Task
> continuationAction)
2576
public
Task
ContinueWhenAny(
Task
[] tasks, Action<
Task
> continuationAction, CancellationToken cancellationToken)
2613
public
Task
ContinueWhenAny(
Task
[] tasks, Action<
Task
> continuationAction, TaskContinuationOptions continuationOptions)
2660
public
Task
ContinueWhenAny(
Task
[] tasks, Action<
Task
> continuationAction, CancellationToken cancellationToken,
2692
public Task<TResult> ContinueWhenAny<TResult>(
Task
[] tasks, Func<
Task
, TResult> continuationFunction)
2727
public Task<TResult> ContinueWhenAny<TResult>(
Task
[] tasks, Func<
Task
, TResult> continuationFunction, CancellationToken cancellationToken)
2768
public Task<TResult> ContinueWhenAny<TResult>(
Task
[] tasks, Func<
Task
, TResult> continuationFunction, TaskContinuationOptions continuationOptions)
2819
public Task<TResult> ContinueWhenAny<TResult>(
Task
[] tasks, Func<
Task
, TResult> continuationFunction, CancellationToken cancellationToken,
3010
public
Task
ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction)
3042
public
Task
ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction,
3081
public
Task
ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction,
3130
public
Task
ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction,
3142
internal static
Task
[] CheckMultiContinuationTasksAndCopy(
Task
[] tasks)
3150
Task
[] tasksCopy = new
Task
[tasks.Length];
system\threading\Tasks\TaskScheduler.cs (27)
77
protected internal abstract void QueueTask(
Task
task);
120
protected abstract bool TryExecuteTaskInline(
Task
task, bool taskWasPreviouslyQueued);
164
protected abstract IEnumerable<
Task
> GetScheduledTasks();
192
internal bool TryRunInline(
Task
task, bool taskWasPreviouslyQueued)
207
(currentStackGuard =
Task
.CurrentStackGuard).TryBeginInliningScope() == false)
244
protected internal virtual bool TryDequeue(
Task
task)
269
internal void InternalQueueTask(
Task
task)
368
Task
currentTask =
Task
.InternalCurrent;
380
/// All <see cref="System.Threading.Tasks.
Task
">Task</see> instances queued to
451
protected bool TryExecuteTask(
Task
task)
470
/// Occurs when a faulted <see cref="System.Threading.Tasks.
Task
"/>'s unobserved exception is about to trigger exception escalation
527
/// Provides an array of all queued <see cref="System.Threading.Tasks.
Task
">Task</see> instances
535
/// <returns>An array of <see cref="System.Threading.Tasks.
Task
">Task</see> instances.</returns>
540
internal
Task
[] GetScheduledTasksForDebugger()
544
IEnumerable<
Task
> activeTasksSource = GetScheduledTasks();
550
Task
[] activeTasksArray = activeTasksSource as
Task
[];
553
activeTasksArray = (new List<
Task
>(activeTasksSource)).ToArray();
557
foreach (
Task
t in activeTasksArray)
619
public IEnumerable<
Task
> ScheduledTasks
665
protected internal override void QueueTask(
Task
task)
679
protected override bool TryExecuteTaskInline(
Task
task, bool taskWasPreviouslyQueued)
691
protected override IEnumerable<
Task
> GetScheduledTasks()
717
Task
task = (
Task
) obj;
725
/// Provides data for the event that is raised when a faulted <see cref="System.Threading.Tasks.
Task
"/>'s
system\threading\Tasks\TaskToApm.cs (6)
45
public static IAsyncResult Begin(
Task
task, AsyncCallback callback, object state)
75
Task
task;
87
task = asyncResult as
Task
;
125
private static void InvokeCallbackWhenTaskCompletes(
Task
antecedent, AsyncCallback callback, IAsyncResult asyncResult)
162
internal readonly
Task
Task;
172
internal TaskWrapperAsyncResult(
Task
task, object state, bool completedSynchronously)
system\threading\Tasks\ThreadPoolTaskScheduler.cs (9)
46
Task
t = obj as
Task
;
56
protected internal override void QueueTask(
Task
task)
82
protected override bool TryExecuteTaskInline(
Task
task, bool taskWasPreviouslyQueued)
104
protected internal override bool TryDequeue(
Task
task)
111
protected override IEnumerable<
Task
> GetScheduledTasks()
116
private IEnumerable<
Task
> FilterTasksFromWorkItems(IEnumerable<IThreadPoolWorkItem> tpwItems)
120
if (tpwi is
Task
)
122
yield return (
Task
)tpwi;
PresentationBuildTasks (1)
BuildTasks\Microsoft\Build\Tasks\Windows\MarkupCompilePass1.cs (1)
1295
System.Threading.Tasks.
Task
.Run(() =>
System (102)
net\System\Net\_ConnectStream.cs (2)
2761
public override
Task
FlushAsync(CancellationToken cancellationToken)
2763
return
Task
.CompletedTask;
net\System\Net\_ListenerRequestStream.cs (2)
77
public override
Task
FlushAsync(CancellationToken cancellationToken)
79
return
Task
.CompletedTask;
net\System\Net\_ListenerResponseStream.cs (2)
85
public override
Task
FlushAsync(CancellationToken cancellationToken)
87
return
Task
.CompletedTask;
net\System\Net\_PooledStream.cs (1)
784
public override
Task
FlushAsync(CancellationToken cancellationToken)
net\System\Net\mail\BufferedReadStream.cs (1)
90
return
Task
.FromResult<int>(read);
net\System\Net\mail\DelegatedStream.cs (2)
153
public override
Task
FlushAsync(CancellationToken cancellationToken)
200
public override
Task
WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
net\System\Net\mail\SmtpClient.cs (2)
721
public
Task
SendMailAsync(string from, string recipients, string subject, string body)
728
public
Task
SendMailAsync(MailMessage message)
net\System\Net\SecureProtocols\NegotiateStream.cs (18)
269
public virtual
Task
AuthenticateAsClientAsync()
271
return
Task
.Factory.FromAsync(BeginAuthenticateAsClient, EndAuthenticateAsClient, null);
275
public virtual
Task
AuthenticateAsClientAsync(NetworkCredential credential, string targetName)
277
return
Task
.Factory.FromAsync(BeginAuthenticateAsClient, EndAuthenticateAsClient, credential, targetName, null);
281
public virtual
Task
AuthenticateAsClientAsync(
286
return
Task
.Factory.FromAsync((callback, state) => BeginAuthenticateAsClient(credential, targetName, requiredProtectionLevel, allowedImpersonationLevel, callback, state), EndAuthenticateAsClient, null);
290
public virtual
Task
AuthenticateAsClientAsync(NetworkCredential credential, ChannelBinding binding, string targetName)
292
return
Task
.Factory.FromAsync(BeginAuthenticateAsClient, EndAuthenticateAsClient, credential, binding, targetName, null);
296
public virtual
Task
AuthenticateAsClientAsync(
301
return
Task
.Factory.FromAsync((callback, state) => BeginAuthenticateAsClient(credential, binding, targetName, requiredProtectionLevel, allowedImpersonationLevel, callback, state), EndAuthenticateAsClient, null);
305
public virtual
Task
AuthenticateAsServerAsync()
307
return
Task
.Factory.FromAsync(BeginAuthenticateAsServer, EndAuthenticateAsServer, null);
311
public virtual
Task
AuthenticateAsServerAsync(ExtendedProtectionPolicy policy)
313
return
Task
.Factory.FromAsync(BeginAuthenticateAsServer, EndAuthenticateAsServer, policy, null);
317
public virtual
Task
AuthenticateAsServerAsync(NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel)
319
return
Task
.Factory.FromAsync(BeginAuthenticateAsServer, EndAuthenticateAsServer, credential, requiredProtectionLevel, requiredImpersonationLevel, null);
323
public virtual
Task
AuthenticateAsServerAsync(
328
return
Task
.Factory.FromAsync((callback, state) => BeginAuthenticateAsServer(credential, policy, requiredProtectionLevel, requiredImpersonationLevel, callback, state), EndAuthenticateAsClient, null);
net\System\Net\SecureProtocols\SslStream.cs (12)
264
public virtual
Task
AuthenticateAsClientAsync(string targetHost)
266
return
Task
.Factory.FromAsync(BeginAuthenticateAsClient, EndAuthenticateAsClient, targetHost, null);
270
public virtual
Task
AuthenticateAsClientAsync(string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation)
276
public virtual
Task
AuthenticateAsClientAsync(string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
278
return
Task
.Factory.FromAsync((callback, state) => BeginAuthenticateAsClient(targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, callback, state), EndAuthenticateAsClient, null);
282
public virtual
Task
AuthenticateAsServerAsync(X509Certificate serverCertificate)
284
return
Task
.Factory.FromAsync(BeginAuthenticateAsServer, EndAuthenticateAsServer, serverCertificate, null);
288
public virtual
Task
AuthenticateAsServerAsync(X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation)
294
public virtual
Task
AuthenticateAsServerAsync(X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
296
return
Task
.Factory.FromAsync((callback, state) => BeginAuthenticateAsServer(serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, callback, state), EndAuthenticateAsServer, null);
300
public virtual
Task
ShutdownAsync()
302
return
Task
.Factory.FromAsync(
net\System\Net\Sockets\NetworkStream.cs (2)
1256
public override
Task
FlushAsync(CancellationToken cancellationToken)
1258
return
Task
.CompletedTask;
net\System\Net\Sockets\TCPClient.cs (6)
401
public
Task
ConnectAsync(IPAddress address, int port)
403
return
Task
.Factory.FromAsync(BeginConnect, EndConnect, address, port, null);
407
public
Task
ConnectAsync(string host, int port)
409
return
Task
.Factory.FromAsync(BeginConnect, EndConnect, host, port, null);
413
public
Task
ConnectAsync(IPAddress[] addresses, int port)
415
return
Task
.Factory.FromAsync(BeginConnect, EndConnect, addresses, port, null);
net\System\Net\webclient.cs (2)
2728
public
Task
DownloadFileTaskAsync(string address, string fileName)
2735
public
Task
DownloadFileTaskAsync(Uri address, string fileName)
net\System\Net\WebRequest.cs (4)
877
return
Task
.Run(() =>
891
return
Task
.Run(() => Task<Stream>.Factory.FromAsync(this.BeginGetRequestStream,
914
return
Task
.Run(() =>
928
return
Task
.Run(() => Task<WebResponse>.Factory.FromAsync(this.BeginGetResponse,
net\System\Net\WebSockets\ClientWebSocket.cs (5)
120
public
Task
ConnectAsync(Uri uri, CancellationToken cancellationToken)
150
private async
Task
ConnectAsyncCore(Uri uri, CancellationToken cancellationToken)
321
public override
Task
SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage,
335
public override
Task
CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription,
342
public override
Task
CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription,
net\System\Net\WebSockets\WebSocket.cs (3)
128
public abstract
Task
CloseAsync(WebSocketCloseStatus closeStatus,
131
public abstract
Task
CloseOutputAsync(WebSocketCloseStatus closeStatus,
137
public abstract
Task
SendAsync(ArraySegment<byte> buffer,
net\System\Net\WebSockets\WebSocketBase.cs (16)
55
private volatile
Task
m_CloseOutputTask;
57
private volatile
Task
m_CloseNetworkConnectionTask;
60
private volatile
Task
m_KeepAliveTask;
279
public override
Task
SendAsync(ArraySegment<byte> buffer,
301
private async
Task
SendAsyncCore(ArraySegment<byte> buffer,
332
Task
keepAliveTask;
399
private async
Task
SendFrameAsync(IList<ArraySegment<byte>> sendBuffers, CancellationToken cancellationToken)
508
public override
Task
CloseOutputAsync(WebSocketCloseStatus closeStatus,
517
private async
Task
CloseOutputAsyncCore(WebSocketCloseStatus closeStatus,
561
Task
closeOutputTask = m_CloseOutputTask;
579
Task
keepAliveTask = m_KeepAliveTask;
754
public override
Task
CloseAsync(WebSocketCloseStatus closeStatus,
762
private async
Task
CloseAsyncCore(WebSocketCloseStatus closeStatus,
800
Task
closeOutputTask;
2489
Task
MultipleWriteAsync(IList<ArraySegment<byte>> buffers, CancellationToken cancellationToken);
2495
Task
CloseNetworkConnectionAsync(CancellationToken cancellationToken);
net\System\Net\WebSockets\WebSocketConnectionStream.cs (14)
90
public async
Task
CloseNetworkConnectionAsync(CancellationToken cancellationToken)
93
await
Task
.Yield();
245
public async override
Task
WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
313
public async
Task
MultipleWriteAsync(IList<ArraySegment<byte>> sendBuffers, CancellationToken cancellationToken)
536
public
Task
CloseNetworkConnectionAsync(CancellationToken cancellationToken)
627
public
Task
MultipleWriteAsync(IList<ArraySegment<byte>> sendBuffers,
635
return
Task
.Factory.FromAsync<IList<ArraySegment<byte>>>(s_BeginMultipleWrite, s_EndMultipleWrite,
667
return
Task
.CompletedTask;
681
public override
Task
WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
719
return
Task
.CompletedTask;
792
return
Task
.FromResult<int>(0);
796
return
Task
.FromResult<int>(m_ReadEventArgs.BytesTransferred);
810
public override
Task
FlushAsync(CancellationToken cancellationToken)
818
return
Task
.CompletedTask;
net\System\Net\WebSockets\WebSocketHelpers.cs (1)
273
internal static ConfiguredTaskAwaitable SuppressContextFlow(this
Task
task)
net\System\Net\WebSockets\WebSocketHttpListenerDuplexStream.cs (7)
343
public
Task
MultipleWriteAsync(IList<ArraySegment<byte>> sendBuffers, CancellationToken cancellationToken)
359
private async
Task
MultipleWriteAsyncCore(IList<ArraySegment<byte>> sendBuffers, CancellationToken cancellationToken)
417
public override
Task
WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
424
private async
Task
WriteAsyncCore(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
597
public override
Task
FlushAsync(CancellationToken cancellationToken)
612
public async
Task
CloseNetworkConnectionAsync(CancellationToken cancellationToken)
615
await
Task
.Yield();
System.Core (33)
System\IO\Pipes\Pipe.cs (11)
627
public
Task
WaitForConnectionAsync(CancellationToken cancellationToken) {
629
return
Task
.FromCancellation(cancellationToken);
633
return
Task
.Factory.StartNew(WaitForConnection, cancellationToken);
638
return
Task
.Factory.FromAsync(BeginWaitForConnection, EndWaitForConnection, cancellationHelper);
641
public
Task
WaitForConnectionAsync() {
1240
public
Task
ConnectAsync() {
1246
public
Task
ConnectAsync(int timeout) {
1250
public
Task
ConnectAsync(CancellationToken cancellationToken) {
1254
public
Task
ConnectAsync(int timeout, CancellationToken cancellationToken) {
1262
return
Task
.FromCancellation(cancellationToken);
1267
return
Task
.Factory.StartNew(() => ConnectInternal(timeout, cancellationToken, startTime), cancellationToken);
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (1)
175
Task
rootTask = new Task(
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (1)
91
Task
rootTask = new Task(
System\Linq\Parallel\Scheduling\QueryTask.cs (4)
64
internal
Task
RunSynchronously(TaskScheduler taskScheduler)
68
Task
task = new Task(s_runTaskSynchronouslyDelegate, this, TaskCreationOptions.AttachedToParent);
82
internal
Task
RunAsynchronously(TaskScheduler taskScheduler)
87
return
Task
.Factory.StartNew(s_baseWorkDelegate, this, new CancellationToken(), TaskCreationOptions.AttachedToParent | TaskCreationOptions.PreferFairness, taskScheduler);
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (2)
31
private
Task
m_rootTask; // The task under which all query tasks root.
78
internal void QueryBegin(
Task
rootTask)
System\Linq\Parallel\Scheduling\SpoolingTask.cs (3)
45
Task
rootTask = new Task(
100
Task
rootTask = new Task(
142
Task
rootTask = new Task(
System\Linq\Parallel\Utils\PLINQETWProvider.cs (4)
97
int taskId =
Task
.CurrentId ?? 0;
126
int taskId =
Task
.CurrentId ?? 0;
156
int taskId =
Task
.CurrentId ?? 0;
187
int taskId =
Task
.CurrentId ?? 0;
System\Threading\Tasks\TaskExtensions.cs (7)
29
/// <see cref="System.Threading.Tasks.
Task
"/> instances.
34
/// Creates a proxy <see cref="System.Threading.Tasks.
Task
">Task</see> that represents the
47
public static
Task
Unwrap(this Task<
Task
> task)
102
Task
promise =
Task
.CreateUnwrapPromise<VoidResult>(task, lookForOce : false);
180
Task<TResult> promise =
Task
.CreateUnwrapPromise<TResult>(task, lookForOce : false);
System.Data (222)
fx\src\data\System\Data\Common\AdapterUtil.cs (2)
82
_trueTask =
Task
.FromResult<bool>(true);
92
_falseTask =
Task
.FromResult<bool>(false);
fx\src\data\System\Data\Common\DBCommand.cs (3)
219
return
Task
.FromResult<int>(ExecuteNonQuery());
255
return
Task
.FromResult<DbDataReader>(ExecuteReader(behavior));
279
return
Task
.FromResult<object>(ExecuteScalar());
fx\src\data\System\Data\Common\DBConnection.cs (2)
180
public
Task
OpenAsync() {
184
public virtual
Task
OpenAsync(CancellationToken cancellationToken) {
fx\src\data\System\Data\Common\DbDataReader.cs (1)
208
return
Task
.FromResult<T>(GetFieldValue<T>(ordinal));
fx\src\data\System\Data\ProviderBase\DbConnectionFactory.cs (1)
224
Task
task = s_pendingOpenNonPooled[idx];
fx\src\data\System\Data\SqlClient\SqlBulkCopy.cs (49)
508
Task
executeTask = _parser.TdsExecuteSQLBatch(TDSCommand, this.BulkCopyTimeout, null, _stateObj, sync: !_isAsyncBulkCopy, callerHasConnectionLock: true);
750
private
Task
SubmitUpdateBulkCommand(string TDSCommand) {
753
Task
executeTask = _parser.TdsExecuteSQLBatch(TDSCommand, this.BulkCopyTimeout, null, _stateObj, sync: !_isAsyncBulkCopy, callerHasConnectionLock: true);
1001
private
Task
ReadFromRowSourceAsync(CancellationToken cts) {
1593
public
Task
WriteToServerAsync(DataRow[] rows) {
1597
public
Task
WriteToServerAsync(DataRow[] rows, CancellationToken cancellationToken) {
1598
Task
resultTask = null;
1642
public
Task
WriteToServerAsync(DbDataReader reader) {
1645
public
Task
WriteToServerAsync(DbDataReader reader, CancellationToken cancellationToken) {
1646
Task
resultTask = null;
1674
public
Task
WriteToServerAsync(IDataReader reader) {
1677
public
Task
WriteToServerAsync(IDataReader reader, CancellationToken cancellationToken) {
1678
Task
resultTask = null;
1706
public
Task
WriteToServerAsync(DataTable table) {
1709
public
Task
WriteToServerAsync(DataTable table, CancellationToken cancellationToken) {
1712
public
Task
WriteToServerAsync(DataTable table, DataRowState rowState) {
1715
public
Task
WriteToServerAsync(DataTable table, DataRowState rowState, CancellationToken cancellationToken) {
1716
Task
resultTask = null;
1747
private
Task
WriteRowSourceToServerAsync(int columnCount, CancellationToken ctoken) {
1748
Task
reconnectTask = _connection._currentReconnectionTask;
1753
Task
writeTask = WriteRowSourceToServerAsync(columnCount, ctoken);
1792
Task
resultTask = WriteToServerInternalAsync(ctoken); // resultTask is null for sync, but Task for async.
1957
private
Task
ReadWriteColumnValueAsync(int col) {
1977
Task
writeTask = null;
2018
private
Task
CopyColumnsAsync(int col, TaskCompletionSource<object> source = null) {
2019
Task
resultTask = null, task = null;
2050
private void CopyColumnsAsyncSetupContinuation(TaskCompletionSource<object> source,
Task
task, int i) {
2117
Task
writeTask = _parser.WriteBulkCopyDone(_stateObj); //We should complete the current batch upto this row.
2126
Task
CheckForCancellation(CancellationToken cts, TaskCompletionSource<object> tcs) {
2139
private TaskCompletionSource<object> ContinueTaskPend(
Task
task, TaskCompletionSource<object> source, Func<TaskCompletionSource<object>> action) {
2158
private
Task
CopyRowsAsync(int rowsSoFar, int totalRows, CancellationToken cts, TaskCompletionSource<object> source = null) {
2159
Task
resultTask = null;
2160
Task
task = null;
2180
Task
readTask = ReadFromRowSourceAsync(cts); // read the next row. Caution: more is only valid if the task returns null. Otherwise, we wait for Task.Result
2198
Task
readTask = ReadFromRowSourceAsync(cts);
2229
private
Task
CopyBatchesAsync(BulkCopySimpleResultSet internalResults, string updateBulkCommandText, CancellationToken cts, TaskCompletionSource<object> source = null) {
2246
Task
commandTask = SubmitUpdateBulkCommand(updateBulkCommandText);
2249
Task
continuedTask = CopyBatchesAsyncContinued(internalResults, updateBulkCommandText, cts, source);
2262
Task
continuedTask = CopyBatchesAsyncContinued(internalResults, updateBulkCommandText, cts, source);
2294
private
Task
CopyBatchesAsyncContinued(BulkCopySimpleResultSet internalResults, string updateBulkCommandText, CancellationToken cts, TaskCompletionSource<object> source) {
2304
Task
task = CopyRowsAsync(0, _savedBatchSize, cts); //this is copying 1 batch of rows and setting _hasMoreRowToCopy = true/false.
2313
Task
continuedTask = CopyBatchesAsyncContinuedOnSuccess(internalResults, updateBulkCommandText, cts, source);
2339
private
Task
CopyBatchesAsyncContinuedOnSuccess(BulkCopySimpleResultSet internalResults, string updateBulkCommandText, CancellationToken cts, TaskCompletionSource<object> source) {
2342
Task
writeTask = _parser.WriteBulkCopyDone(_stateObj);
2397
Task
task = _parser.WriteBulkCopyDone(_stateObj);
2458
Task
task = null;
2564
Task
reconnectTask;
2661
private
Task
WriteToServerInternalAsync(CancellationToken ctoken) {
2683
Task
readTask = ReadFromRowSourceAsync(ctoken); // readTask == reading task. This is the first read call. "more" is valid only if readTask == null;
fx\src\data\System\Data\SqlClient\SqlCommand.cs (34)
1275
Task
execNQ = InternalExecuteNonQuery(localCompletion, ADP.BeginExecuteNonQuery, false, timeout, out usedCache, asyncWrite, inRetry: inRetry);
1361
private void VerifyEndExecuteState(
Task
completionTask, String endMethod, bool fullCheckForColumnEncryption = false) {
1404
Task
completionTask = (
Task
) asyncResult;
1445
Exception asyncException = ((
Task
)asyncResult).Exception;
1516
VerifyEndExecuteState((
Task
)asyncResult, endMethod);
1522
VerifyEndExecuteState((
Task
)asyncResult, endMethod, fullCheckForColumnEncryption: true);
1600
private
Task
InternalExecuteNonQuery(TaskCompletionSource<object> completion, string methodName, bool sendToPipe, int timeout, out bool usedCache, bool asyncWrite = false, bool inRetry = false) {
1627
Task
task = null;
1765
Task
writeTask;
1870
Exception asyncException = ((
Task
)asyncResult).Exception;
2076
Exception asyncException = ((
Task
)asyncResult).Exception;
2158
Task
writeTask = null;
2356
VerifyEndExecuteState((
Task
)asyncResult, endMethod);
2362
VerifyEndExecuteState((
Task
)asyncResult, endMethod, fullCheckForColumnEncryption: true);
3058
private
Task
RunExecuteNonQueryTds(string methodName, bool async, int timeout, bool asyncWrite ) {
3063
Task
reconnectTask = _activeConnection.ValidateAndReconnect(null, timeout);
3080
Task
subTask = RunExecuteNonQueryTds(methodName, async, TdsParserStaticMethods.GetRemainingTimeout(timeout, reconnectionStart), asyncWrite);
3110
Task
executeTask = _stateObj.Parser.TdsExecuteSQLBatch(this.CommandText, timeout, this.Notification, _stateObj, sync: true);
3281
private void PrepareForTransparentEncryption(CommandBehavior cmdBehavior, bool returnStream, bool async, int timeout, TaskCompletionSource<object> completion, out
Task
returnTask, bool asyncWrite, out bool usedCache, bool inRetry) {
3283
Task
fetchInputParameterEncryptionInfoTask = null;
3440
returnTask =
Task
.Run(() => {
3574
out
Task
task,
4097
Task
unused; // sync execution
4105
internal SqlDataReader RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, bool returnStream, string method, TaskCompletionSource<object> completion, int timeout, out
Task
task, out bool usedCache, bool asyncWrite = false, bool inRetry = false) {
4160
Task
returnTask = null;
4268
out
Task
task,
4273
Task
describeParameterEncryptionTask = null) {
4285
Task
subTask = null;
4342
private SqlDataReader RunExecuteReaderTds( CommandBehavior cmdBehavior, RunBehavior runBehavior, bool returnStream, bool async, int timeout, out
Task
task, bool asyncWrite, bool inRetry, SqlDataReader ds=null, bool describeParameterEncryptionRequest = false) {
4349
Task
reconnectTask = _activeConnection.ValidateAndReconnect(null, timeout);
4366
Task
subTask;
4413
Task
writeTask = null;
4520
Task
executeTask = _stateObj.Parser.TdsExecuteSQLBatch(optionSettings, timeout, this.Notification, _stateObj, sync: true);
fx\src\data\System\Data\SqlClient\SqlConnection.cs (19)
278
Tuple<TaskCompletionSource<DbConnectionInternal>,
Task
> _currentCompletion;
288
internal
Task
_currentReconnectionTask;
289
private
Task
_asyncWaitingForReconnection; // current async task waiting for reconnection in non-MARS connections
705
Task
reconnectTask = _currentReconnectionTask;
732
Task
reconnectTask=_currentReconnectionTask;
1089
Task
reconnectTask = _currentReconnectionTask;
1211
internal void RegisterWaitingForReconnect(
Task
waitingTask) {
1221
private async
Task
ReconnectAsync(int timeout) {
1264
await
Task
.Delay(1000 * ConnectRetryInterval, ctoken).ConfigureAwait(false);
1274
internal
Task
ValidateAndReconnect(Action beforeDisconnect, int timeout) {
1275
Task
runningReconnect = _currentReconnectionTask;
1279
Interlocked.CompareExchange<
Task
>(ref _currentReconnectionTask, null, runningReconnect);
1319
runningReconnect =
Task
.Run(() => ReconnectAsync(timeout));
1365
Task
reconnectTask = _currentReconnectionTask;
1383
public override
Task
OpenAsync(CancellationToken cancellationToken) {
1437
_currentCompletion = new Tuple<TaskCompletionSource<DbConnectionInternal>,
Task
>(completion, result.Task);
1639
Task
reconnectTask = _currentReconnectionTask;
1696
Task
asyncWaitingForReconnection=_asyncWaitingForReconnection;
1706
Task
currentReconnectionTask = _currentReconnectionTask;
fx\src\data\System\Data\SqlClient\SqlDataReader.cs (23)
92
private
Task
_currentTask;
809
var
currentTask = _currentTask;
3687
Task
executeTask = parser.TdsExecuteSQLBatch(_resetOptionsString, (_command != null) ? _command.CommandTimeout : 0, null, stateObj, sync: true);
3953
Task
original = Interlocked.CompareExchange(ref _currentTask, source.Task, null);
3968
Func<
Task
, Task<bool>> moreFunc = null;
4021
Task
original = Interlocked.CompareExchange(ref _currentTask, source.Task, null);
4029
Func<
Task
, Task<int>> moreFunc = null;
4067
return
Task
.FromResult<int>(totalBytesRead);
4113
Task
original = Interlocked.CompareExchange(ref _currentTask, source.Task, null);
4135
Func<
Task
, Task<int>> moreFunc = null;
4157
return
Task
.FromResult<int>(totalBytesRead);
4264
Task
original = Interlocked.CompareExchange(ref _currentTask, source.Task, null);
4284
Func<
Task
, Task<bool>> moreFunc = null;
4384
Task
original = Interlocked.CompareExchange(ref _currentTask, source.Task, null);
4407
Func<
Task
, Task<bool>> moreFunc = null;
4436
return
Task
.FromResult<T>(GetFieldValueFromSqlBufferInternal<T>(data[i], metaData[i]));
4467
return
Task
.FromResult(GetFieldValueInternal<T>(i));
4485
Task
original = Interlocked.CompareExchange(ref _currentTask, source.Task, null);
4508
Func<
Task
, Task<T>> moreFunc = null;
4515
return
Task
.FromResult<T>(GetFieldValueFromSqlBufferInternal<T>(_data[i], _metaData[i]));
4564
private Task<T> ContinueRetryable<T>(Func<
Task
, Task<T>> moreFunc) {
4620
private Task<T> InvokeRetryable<T>(Func<
Task
, Task<T>> moreFunc, TaskCompletionSource<T> source, IDisposable objectToDispose = null) {
4659
Task
current = Interlocked.CompareExchange(ref _currentTask, null, source.Task);
fx\src\data\System\Data\SqlClient\SqlInternalConnectionTds.cs (9)
671
Threading.Tasks.
Task
executeTask = _parser.TdsExecuteSQLBatch("use " + database, ConnectionOptions.ConnectTimeout, null, _parser._physicalStateObj, sync: true);
888
Threading.Tasks.
Task
executeTask = _parser.TdsExecuteSQLBatch("sp_reset_connection", 30, null, _parser._physicalStateObj, sync: true);
1032
Threading.Tasks.
Task
executeTask = _parser.TdsExecuteSQLBatch(sqlBatch.ToString(), ConnectionOptions.ConnectTimeout, null, _parser._physicalStateObj, sync: true);
1120
Task
reconnectTask = internalTransaction.Parent.Connection.ValidateAndReconnect(() => {
2042
Task
reconnectTask = parent.ValidateAndReconnect(() => {
2395
Task
.Run(() => fedAuthToken = authProvider.AcquireTokenAsync(authParamsBuilder).Result.ToSqlFedAuthToken()).Wait();
2404
Task
.Run(() => fedAuthToken = authProvider.AcquireTokenAsync(authParamsBuilder).Result.ToSqlFedAuthToken()).Wait();
2415
Task
.Run(() => fedAuthToken = authProvider.AcquireTokenAsync(authParamsBuilder).Result.ToSqlFedAuthToken()).Wait();
2419
Task
.Run(() => fedAuthToken = authProvider.AcquireTokenAsync(authParamsBuilder).Result.ToSqlFedAuthToken()).Wait();
fx\src\data\System\Data\SqlClient\SqlSequentialStream.cs (5)
13
private
Task
_currentTask; // Holds the current task being processed
124
Task
readTask = ReadAsync(buffer, offset, count, CancellationToken.None);
166
Task
original = Interlocked.CompareExchange<
Task
>(ref _currentTask, completion.Task, null);
291
var
currentTask = _currentTask;
fx\src\data\System\Data\SqlClient\SqlSequentialTextReader.cs (4)
18
private
Task
_currentTask; // The current async task
140
Task
original = Interlocked.CompareExchange<
Task
>(ref _currentTask, completion.Task, null);
292
var
currentTask = _currentTask;
fx\src\data\System\Data\SqlClient\SqlUtil.cs (7)
32
internal static
Task
CreateContinuationTask(
Task
task, Action onSuccess, SqlInternalConnectionTds connectionToDoom = null, Action<Exception> onFailure = null) {
46
internal static
Task
CreateContinuationTask<T1, T2>(
Task
task, Action<T1, T2> onSuccess, T1 arg1, T2 arg2, SqlInternalConnectionTds connectionToDoom = null, Action<Exception> onFailure = null) {
50
internal static void ContinueTask(
Task
task,
152
internal static void WaitForCompletion(
Task
task, int timeout, Action onTimeout = null, bool rethrowExceptions=true) {
171
Task
.Delay(timeout * 1000, ctoken).ContinueWith((tsk) => {
fx\src\data\System\Data\SqlClient\TdsParser.cs (46)
34
static
Task
completedTask;
35
static
Task
CompletedTask {
38
completedTask =
Task
.FromResult<object>(null);
1296
Task
.Factory.StartNew(() => {
5816
internal
Task
WriteSqlVariantValue(object value, int length, int offset, TdsParserStateObject stateObj, bool canAccumulate = true) {
5980
internal
Task
WriteSqlVariantDataRowValue(object value, TdsParserStateObject stateObj, bool canAccumulate = true) {
6550
private
Task
WriteString(string s, TdsParserStateObject stateObj, bool canAccumulate = true) {
6562
internal
Task
WriteCharArray(char[] carr, int length, int offset, TdsParserStateObject stateObj, bool canAccumulate = true) {
6589
internal
Task
WriteString(string s, int length, int offset, TdsParserStateObject stateObj, bool canAccumulate = true) {
6669
private
Task
WriteEncodingChar(string s, Encoding encoding, TdsParserStateObject stateObj, bool canAccumulate = true) {
6690
private
Task
WriteEncodingChar(string s, int numChars, int offset, Encoding encoding, TdsParserStateObject stateObj, bool canAccumulate = true) {
7840
Task
writeTask = stateObj.WritePacket(TdsEnums.HARDFLUSH);
7932
internal
Task
TdsExecuteSQLBatch(string text, int timeout, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, bool sync, bool callerHasConnectionLock = false, byte[] enclavePackage = null) {
7994
Task
executeTask = stateObj.ExecuteFlush();
8044
internal
Task
TdsExecuteRPC(SqlCommand cmd, _SqlRPC[] rpcArray, int timeout, bool inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, bool isCommandProc, bool sync = true,
8514
Task
writeParamTask = null;
8538
Task
task = null;
8580
Task
execFlushTask = stateObj.ExecuteFlush();
8583
Task
task = null;
8688
private void ExecuteFlushTaskCallback(
Task
tsk, TdsParserStateObject stateObj, TaskCompletionSource<object> completion, bool releaseConnectionLock) {
9130
internal
Task
WriteBulkCopyDone(TdsParserStateObject stateObj) {
9489
internal
Task
WriteBulkCopyValue(object value, SqlMetaDataPriv metadata, TdsParserStateObject stateObj, bool isSqlType, bool isDataFeed, bool isNull) {
9497
Task
resultTask = null;
9498
Task
internalWriteTask = null;
9649
private
Task
WriteBulkCopyValueSetupContinuation(
Task
internalWriteTask, Encoding saveEncoding, SqlCollation saveCollation, int saveCodePage, int saveLCID) {
9650
return internalWriteTask.ContinueWith<
Task
>(t => {
9924
private
Task
GetTerminationTask(
Task
unterminatedWriteTask, object value, MetaType type, int actualLength, TdsParserStateObject stateObj, bool isDataFeed) {
9942
private
Task
WriteSqlValue(object value, MetaType type, int actualLength, int codePageByteSize, int offset, TdsParserStateObject stateObj) {
9950
private
Task
WriteUnterminatedSqlValue(object value, MetaType type, int actualLength, int codePageByteSize, int offset, TdsParserStateObject stateObj) {
10184
public override
Task
WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) {
10201
Task
task = null;
10285
public override
Task
FlushAsync() {
10309
public override
Task
WriteAsync(char value) {
10319
public override
Task
WriteAsync(char[] buffer, int index, int count) {
10333
public override
Task
WriteAsync(string value) {
10360
private async
Task
WriteXmlFeed(XmlDataFeed feed, TdsParserStateObject stateObj, bool needBom, Encoding encoding, int size) {
10405
private async
Task
WriteTextFeed(TextDataFeed feed, Encoding encoding, bool needBom, TdsParserStateObject stateObj, int size) {
10454
private async
Task
WriteStreamFeed(StreamDataFeed feed, TdsParserStateObject stateObj, int len) {
10489
private
Task
NullIfCompletedWriteTask(
Task
task) {
10505
private
Task
WriteValue(object value, MetaType type, byte scale, int actualLength, int encodingByteSize, int offset, TdsParserStateObject stateObj, int paramSize, bool isDataFeed) {
10512
private
Task
WriteUnterminatedValue(object value, MetaType type, byte scale, int actualLength, int encodingByteSize, int offset, TdsParserStateObject stateObj, int paramSize, bool isDataFeed)
10711
private
Task
WriteEncryptionMetadata(
Task
terminatedWriteTask, SqlColumnEncryptionInputParameterInfo columnEncryptionParameterInfo, TdsParserStateObject stateObj) {
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (17)
953
internal
Task
ExecuteFlush() {
961
Task
writePacketTask = WritePacket(TdsEnums.HARDFLUSH);
2070
Task
.Delay(AttentionTimeoutSeconds * 1000).ContinueWith(_ => {
2549
Task
.Factory.StartNew(() => {
2667
internal
Task
WaitForAccumulatedWrites( ) {
2681
Task
task = _writeCompletionSource.Task;
2725
internal
Task
WriteByteArray(Byte[] b, int len, int offsetBuffer, bool canAccumulate=true, TaskCompletionSource<object> completion = null) {
2760
Task
packetTask = WritePacket(TdsEnums.SOFTFLUSH, canAccumulate);
2763
Task
task = null;
2803
private void WriteByteArraySetupContinuation(Byte[] b, int len, TaskCompletionSource<object> completion, int offset,
Task
packetTask) {
2810
internal
Task
WritePacket(byte flushMode, bool canAccumulate = false) {
2854
Task
task=null;
2887
private
Task
SNIWritePacket(SNIHandle handle, SNIPacket packet, out UInt32 sniError, bool canAccumulate, bool callerHasConnectionLock) {
2894
Task
task = null;
2899
Task
waitForWrites = WaitForAccumulatedWrites();
3070
private
Task
WriteSni(bool canAccumulate) {
3077
Task
task = SNIWritePacket(Handle, packet, out sniError, canAccumulate, callerHasConnectionLock: true);
System.Runtime.Serialization (7)
System\Xml\XmlDictionaryWriter.cs (7)
34
public override
Task
WriteBase64Async(byte[] buffer, int index, int count)
36
return
Task
.Factory.FromAsync(this.BeginWriteBase64, this.EndWriteBase64, buffer, index, count, null);
235
public virtual
Task
WriteValueAsync(IStreamProvider value)
237
return
Task
.Factory.FromAsync(this.BeginWriteValue, this.EndWriteValue, value, null);
656
Task
task = (
Task
)result;
674
if (result.CompletedSynchronously && !(result is
Task
))
System.ServiceModel (41)
System\ServiceModel\Channels\HttpChannelHelpers.cs (3)
1582
protected override
Task
SerializeToStreamAsync(Stream stream, TransportContext context)
3250
internal static void HandleContinueWithTask(
Task
task)
3255
internal static void HandleContinueWithTask(
Task
task, Action<Exception> exceptionHandler)
System\ServiceModel\Channels\OpaqueContent.cs (1)
71
protected override
Task
SerializeToStreamAsync(Stream stream, TransportContext context)
System\ServiceModel\Channels\ServiceChannelProxy.cs (12)
213
static Func<ServiceChannel, ProxyOperationRuntime, object[],
Task
> GetOrCreateTaskDelegate(Type taskResultType)
215
Func<ServiceChannel, ProxyOperationRuntime, object[],
Task
> createTaskDelegate = createGenericTaskDelegateCache[taskResultType] as Func<ServiceChannel, ProxyOperationRuntime, object[],
Task
>;
223
createTaskDelegate = createGenericTaskDelegateCache[taskResultType] as Func<ServiceChannel, ProxyOperationRuntime, object[],
Task
>;
230
createTaskDelegate = Delegate.CreateDelegate(typeof(Func<ServiceChannel, ProxyOperationRuntime, object[],
Task
>), methodInfo) as Func<ServiceChannel, ProxyOperationRuntime, object[],
Task
>;
237
public static
Task
CreateTask(ServiceChannel channel, IMethodCallMessage methodCall, ProxyOperationRuntime operation)
246
static
Task
CreateGenericTask(ServiceChannel channel, ProxyOperationRuntime operation, object[] inputParameters)
248
Func<ServiceChannel, ProxyOperationRuntime, object[],
Task
> createTaskDelegate = GetOrCreateTaskDelegate(operation.TaskTResult);
252
static
Task
CreateTask(ServiceChannel channel, ProxyOperationRuntime operation, object[] inputParameters)
269
return
Task
.Factory.FromAsync(beginCallDelegate, endCallDelegate, channel, operation, inputParameters, OperationContext.Current);
294
Task
task = TaskCreator.CreateTask(this.serviceChannel, methodCall, operation);
System\ServiceModel\Channels\WebSocketConnectionHandler.cs (1)
63
return
Task
.Factory.StartNew(
System\ServiceModel\Channels\WebSocketHelper.cs (1)
325
internal static void ThrowExceptionOnTaskFailure(
Task
task, TimeSpan timeout, string operation)
System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (15)
159
Task
closeTask = this.CloseAsync();
184
Task
task = this.CloseOutputAsync(CancellationToken.None);
220
Task
task = this.WebSocket.SendAsync(messageData, outgoingMessageType, true, cancellationTokenSource.Token);
286
Task
task = this.CloseOutputAsync(cancellationTokenSource.Token);
342
Task
task = this.WebSocket.SendAsync(messageData, outgoingMessageType, true, CancellationToken.None);
412
private
Task
CloseAsync()
430
private
Task
CloseOutputAsync(CancellationToken cancellationToken)
643
async
Task
ReadBufferedMessageAsync()
1222
WebSocketHelper.ThrowExceptionOnTaskFailure((
Task
)task, TimeoutHelper.FromMilliseconds(this.ReadTimeout), WebSocketHelper.ReceiveOperation);
1319
Task
task = this.webSocket.SendAsync(new ArraySegment<byte>(buffer, offset, count), this.outgoingMessageType, false, CancellationToken.None);
1349
Task
task = this.webSocket.SendAsync(new ArraySegment<byte>(buffer, offset, count), this.outgoingMessageType, false, cancellationTokenSource.Token).ContinueWith(t =>
1365
Task
task = (
Task
)asyncResult;
1381
Task
task = this.webSocket.SendAsync(new ArraySegment<byte>(EmptyArray<byte>.Instance, 0, 0), this.outgoingMessageType, true, CancellationToken.None);
1405
Task
task = this.webSocket.SendAsync(new ArraySegment<byte>(EmptyArray<byte>.Instance, 0, 0), this.outgoingMessageType, true, cancellationTokenSource.Token);
System\ServiceModel\Description\MetadataExchangeClient.cs (3)
314
return
Task
.Factory.FromAsync<MetadataRetriever, MetadataSet>(this.BeginGetMetadata, this.EndGetMetadata, retriever, /* state */ null);
324
return
Task
.Factory.FromAsync<MetadataRetriever, MetadataSet>(this.BeginGetMetadata, this.EndGetMetadata, new MetadataReferenceRetriever(address, this), /* state */ null);
339
return
Task
.Factory.FromAsync<MetadataRetriever, MetadataSet>(this.BeginGetMetadata, this.EndGetMetadata, new MetadataReferenceRetriever(address, via, this), /* state */ null);
System\ServiceModel\Description\ServiceReflector.cs (1)
341
internal static readonly Type taskType = typeof(
Task
);
System\ServiceModel\Dispatcher\TaskMethodInvoker.cs (4)
99
Task
task = null;
111
task = tuple.Item1 as
Task
;
223
var
returnValueTask = returnValue as
Task
;
System.ServiceModel.Activation (1)
System\ServiceModel\Activation\HostedHttpContext.cs (1)
117
Task
PostAcceptWebSocket(AspNetWebSocketContext context)
System.ServiceModel.Channels (4)
System\ServiceModel\Channels\ByteStreamMessage.cs (2)
557
Task
t = result as
Task
;
System\ServiceModel\Channels\XmlByteStreamWriter.cs (2)
128
public override
Task
WriteBase64Async(byte[] buffer, int index, int count)
130
return
Task
.Factory.FromAsync(this.BeginWriteBase64, this.EndWriteBase64, buffer, index, count, null);
System.ServiceModel.Discovery (4)
System\ServiceModel\Discovery\AnnouncementClient.cs (4)
391
public
Task
AnnounceOnlineTaskAsync(EndpointDiscoveryMetadata discoveryMetadata)
393
return
Task
.Factory.FromAsync<EndpointDiscoveryMetadata>(this.BeginAnnounceOnline, this.EndAnnounceOnline, discoveryMetadata, /* state */ null);
397
public
Task
AnnounceOfflineTaskAsync(EndpointDiscoveryMetadata discoveryMetadata)
399
return
Task
.Factory.FromAsync<EndpointDiscoveryMetadata>(this.BeginAnnounceOffline, this.EndAnnounceOffline, discoveryMetadata, /* state */ null);
System.ServiceModel.Internals (8)
System\Runtime\TaskExtensions.cs (8)
55
public static IAsyncResult AsAsyncResult(this
Task
task, AsyncCallback callback, object state)
97
public static ConfiguredTaskAwaitable SuppressContextFlow(this
Task
task)
107
public static ConfiguredTaskAwaitable ContinueOnCapturedContextFlow(this
Task
task)
117
public static void Wait<TException>(this
Task
task)
129
public static bool Wait<TException>(this
Task
task, int millisecondsTimeout)
141
public static bool Wait<TException>(this
Task
task, TimeSpan timeout)
160
public static void Wait(this
Task
task, TimeSpan timeout, Action<Exception, TimeSpan, string> exceptionConverter, string operationType)
194
Task
.FromResult((TBase)task.Result) :
System.Web (126)
Abstractions\HttpContextBase.cs (2)
239
public virtual void AcceptWebSocketRequest(Func<AspNetWebSocketContext,
Task
> userFunc) {
243
public virtual void AcceptWebSocketRequest(Func<AspNetWebSocketContext,
Task
> userFunc, AspNetWebSocketOptions options) {
Abstractions\HttpContextWrapper.cs (2)
246
public override void AcceptWebSocketRequest(Func<AspNetWebSocketContext,
Task
> userFunc) {
250
public override void AcceptWebSocketRequest(Func<AspNetWebSocketContext,
Task
> userFunc, AspNetWebSocketOptions options) {
Abstractions\HttpResponseBase.cs (1)
365
public virtual
Task
FlushAsync() {
Abstractions\HttpResponseWrapper.cs (1)
360
public override
Task
FlushAsync() {
AspNetSynchronizationContext.cs (1)
134
internal void PostAsync(Func<object,
Task
> callback, Object state) {
AspNetSynchronizationContextBase.cs (1)
43
internal
Task
WaitForPendingOperationsAsync() {
Handlers\TransferRequestHandler.cs (2)
23
private
Task
ProcessRequestAsync(HttpContext context) {
40
var
releaseStateTask = context.ApplicationInstance.EnsureReleaseStateAsync();
Hosting\ApplicationManager.cs (2)
623
ApplicationResumeStateContainer[] resumeContainers =
Task
.WhenAll(allAppDomainContexts.Select(CreateSuspendTask)).Result;
627
private static Task<ApplicationResumeStateContainer> _dummyCompletedSuspendTask =
Task
.FromResult<ApplicationResumeStateContainer>(null);
Hosting\BackgroundWorkScheduler.cs (4)
33
private async void RunWorkItemImpl(Func<CancellationToken,
Task
> workItem) {
34
Task
returnedTask = null;
58
public void ScheduleWorkItem(Func<CancellationToken,
Task
> workItem) {
76
RunWorkItemImpl((Func<CancellationToken,
Task
>)state);
Hosting\HostingEnvironment.cs (3)
143
private static readonly Task<object> _completedTask =
Task
.FromResult<object>(null);
1175
public static void QueueBackgroundWorkItem(Func<CancellationToken,
Task
> workItem) {
1186
private void QueueBackgroundWorkItemInternal(Func<CancellationToken,
Task
> workItem) {
HttpApplication.cs (2)
57
public delegate
Task
TaskEventHandler(object sender, EventArgs e);
527
internal
Task
EnsureReleaseStateAsync() {
HttpContext.cs (2)
278
public void AcceptWebSocketRequest(Func<AspNetWebSocketContext,
Task
> userFunc) {
283
public void AcceptWebSocketRequest(Func<AspNetWebSocketContext,
Task
> userFunc, AspNetWebSocketOptions options) {
HttpResponse.cs (2)
781
public
Task
FlushAsync() {
782
return
Task
.Factory.FromAsync(BeginFlush, EndFlush, state: null);
HttpTaskAsyncHandler.cs (1)
35
public abstract
Task
ProcessRequestAsync(HttpContext context);
State\SessionStateModule.cs (1)
1519
public
Task
ReleaseSessionStateAsync(HttpContext context) {
TaskAsyncHelper.cs (5)
19
private static readonly
Task
s_completedTask =
Task
.FromResult<object>(null);
21
internal static IAsyncResult BeginTask(Func<
Task
> taskFunc, AsyncCallback callback, object state) {
22
Task
task = taskFunc();
81
internal static
Task
CompletedTask {
TaskWrapperAsyncResult.cs (2)
22
internal TaskWrapperAsyncResult(
Task
task, object asyncState) {
44
internal
Task
Task {
UI\Control.cs (3)
1759
internal async
Task
InitRecursiveAsync(Control namingContainer, Page page) {
2280
internal async
Task
LoadRecursiveAsync(Page page) {
2355
internal async
Task
PreRenderRecursiveInternalAsync(Page page) {
UI\IPageAsyncTask.cs (1)
16
Task
ExecuteAsync(object sender, EventArgs e, CancellationToken cancellationToken);
UI\Page.cs (10)
3136
private async
Task
ProcessPostDataAsync(NameValueCollection postData, bool fBeforeLoad) {
3288
internal async
Task
RaiseChangedEventsAsync() {
4252
private async
Task
PerformPreInitAsync() {
4468
private async
Task
ProcessRequestAsync(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint) {
4919
private async
Task
ProcessRequestMainAsync(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint) {
5039
Task
initRecursiveTask = InitRecursiveAsync(null, this);
5344
private async
Task
PrepareCallbackAsync(string callbackControlID) {
6010
private async
Task
ProcessRequestAsync(HttpContext context) {
6024
Task
preWorkTask = null;
6057
Task
postWorkTask = null;
UI\PageAsyncTask.cs (7)
50
public PageAsyncTask(Func<
Task
> handler)
54
public PageAsyncTask(Func<CancellationToken,
Task
> handler)
59
internal PageAsyncTask(Func<CancellationToken,
Task
> handler, SynchronizationContextMode currentMode) {
81
internal Func<CancellationToken,
Task
> TaskHandler { get; private set; }
83
private static Func<CancellationToken,
Task
> WrapParameterlessTaskHandler(Func<
Task
> handler) {
85
? (Func<CancellationToken,
Task
>)(_ => handler())
UI\PageAsyncTaskApm.cs (1)
26
public async
Task
ExecuteAsync(object sender, EventArgs e, CancellationToken cancellationToken) {
UI\PageAsyncTaskManager.cs (1)
30
public async
Task
ExecuteTasksAsync(object sender, EventArgs e, CancellationToken cancellationToken, AspNetSynchronizationContextBase syncContext, IRequestCompletedNotifier requestCompletedNotifier) {
UI\PageAsyncTaskTap.cs (3)
16
private readonly Func<CancellationToken,
Task
> _handler;
18
public PageAsyncTaskTap(Func<CancellationToken,
Task
> handler) {
22
public
Task
ExecuteAsync(object sender, EventArgs e, CancellationToken cancellationToken) {
UI\TemplateControl.cs (4)
473
var handler = FastDelegateCreator<Func<CancellationToken,
Task
>>.BindTo(this, preRenderCompleteAsyncEvent.MethodInfo);
477
var handler = FastDelegateCreator<Func<
Task
>>.BindTo(this, preRenderCompleteAsyncEvent.MethodInfo);
544
MethodInfo parameterfulMethod = GetInstanceMethodInfo(typeof(Func<CancellationToken,
Task
>), methodName);
551
MethodInfo parameterlessMethod = GetInstanceMethodInfo(typeof(Func<
Task
>), methodName);
UI\WebControls\ModelDataSourceView.cs (15)
47
private
Task
_viewOperationTask = null;
337
bool returnTypeIsTask = typeof(
Task
).IsAssignableFrom(methodInfo.ReturnType);
720
Func<object,
Task
> func = GetSelectAsyncFunc(arguments, callback, method);
735
private Func<object,
Task
> GetSelectAsyncFunc(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback, ModelDataSourceMethod method) {
736
Func<object,
Task
> func = async _ => {
746
await (
Task
)result.ReturnValue;
755
var
viewOperationTask = _viewOperationTask;
787
ViewOperationAsync((cancellationToken) => (
Task
)GetInsertMethodResult(values, method, true/*isAsyncMethod*/, cancellationToken), callback);
801
ViewOperationAsync((cancellationToken) => (
Task
)GetUpdateMethodResult(keys, values, oldValues, method, true/*isAsyncMethod*/, cancellationToken), callback);
815
ViewOperationAsync((cancellationToken) => (
Task
)GetDeleteMethodResult(keys, oldValues, method, true/*isAsyncMethod*/, cancellationToken), callback);
822
private void ViewOperationAsync(Func<CancellationToken,
Task
> asyncViewOperation, DataSourceViewOperationCallback callback) {
825
Func<object,
Task
> func = async _ => {
828
var
viewOperationTask = _viewOperationTask;
833
var
operationTask = asyncViewOperation(cancellationToken);
929
internal Func<object,
Task
> SelectAsyncInternal(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback, ModelDataSourceMethod method) {
Util\CountdownTask.cs (1)
31
public
Task
Task {
Util\SynchronizationHelper.cs (15)
19
private
Task
_completionTask; // the Task that will run when all in-flight operations have completed
21
private
Task
_lastScheduledTask = CreateInitialTask(); // the last Task that was queued to this helper, used to hook future Tasks (not volatile since always accessed under lock)
22
private
Task
_lastScheduledTaskAsync = CreateInitialTask(); // the last async Task that was queued to this helper
51
Task
completionTask = Interlocked.Exchange(ref _completionTask, null);
67
private static
Task
CreateInitialTask() {
68
return
Task
.FromResult<object>(null);
83
Task
lastTask;
108
Task
newTask = _lastScheduledTask.ContinueWith(_ => SafeWrapCallback(action), TaskScheduler.Default);
116
public void QueueAsynchronousAsync(Func<object,
Task
> func, object state) {
130
Task
newTask = _lastScheduledTaskAsync.ContinueWith(
179
private async
Task
SafeWrapCallbackAsync(Func<object,
Task
> func, object state) {
181
TaskCompletionSource<
Task
> tcs = new TaskCompletionSource<
Task
>();
183
var
t = func(state);
Util\TaskExtensions.cs (2)
18
public static void ThrowIfFaulted(this
Task
task) {
24
public static WithinCancellableCallbackTaskAwaitable WithinCancellableCallback(this
Task
task, HttpContext context) {
Util\WithinCancellableCallbackTaskAwaitable.cs (2)
18
internal static readonly WithinCancellableCallbackTaskAwaitable Completed = new WithinCancellableCallbackTaskAwaitable(null, ((
Task
)
Task
.FromResult((object)null)).GetAwaiter());
WebSocketPipeline.cs (5)
26
private Func<AspNetWebSocketContext,
Task
> _userFunc;
29
public WebSocketPipeline(RootedObjects root, HttpContext httpContext, Func<AspNetWebSocketContext,
Task
> userFunc, string subProtocol) {
47
Task
abortTask = webSocketTask.ContinueWith(task => (task.Result != null) ? ((AspNetWebSocket)task.Result).AbortAsync() : (
Task
)null, TaskContinuationOptions.ExecuteSynchronously).Unwrap();
108
Task
task = null;
WebSockets\AspNetWebSocket.cs (15)
75
private static readonly
Task
_completedTask =
Task
.FromResult<object>(null);
76
private static readonly Func<
Task
> _completedTaskFunc = () => _completedTask;
207
internal
Task
AbortAsync() {
221
public override
Task
CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) {
225
private Func<
Task
> CloseAsyncImpl(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken, bool performValidation = true) {
226
Func<
Task
> sendCloseTaskFunc = null;
269
Task
sendCloseTask = (sendCloseTaskFunc != null) ? sendCloseTaskFunc() : null;
295
public override
Task
CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) {
299
private Func<
Task
> CloseOutputAsyncImpl(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken, bool performValidation = true) {
430
public override
Task
SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) {
434
private Func<
Task
> SendAsyncImpl(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken, bool performValidation = true) {
607
internal
Task
DoWork(Func<
Task
> taskDelegate, CancellationToken cancellationToken) {
612
Task
IAsyncAbortableWebSocket.AbortAsync() {
WebSockets\AspNetWebSocketManager.cs (2)
49
Task
[] abortTasks = Array.ConvertAll(sockets, socket => socket.AbortAsync());
50
Task
.WaitAll(abortTasks);
WebSockets\IAsyncAbortableWebSocket.cs (1)
16
Task
AbortAsync();
WebSockets\IWebSocketPipe.cs (2)
26
Task
WriteCloseFragmentAsync(WebSocketCloseStatus closeStatus, string statusDescription);
29
Task
WriteFragmentAsync(ArraySegment<byte> buffer, bool isUtf8Encoded, bool isFinalFragment);
WebSockets\WebSocketPipe.cs (2)
39
public
Task
WriteFragmentAsync(ArraySegment<byte> buffer, bool isUtf8Encoded, bool isFinalFragment) {
85
public
Task
WriteCloseFragmentAsync(WebSocketCloseStatus closeStatus, string statusDescription) {
System.Xml (497)
System\Xml\AsyncHelper.cs (20)
9
public static readonly
Task
DoneTask =
Task
.FromResult(true);
11
public static readonly Task<bool> DoneTaskTrue =
Task
.FromResult(true);
13
public static readonly Task<bool> DoneTaskFalse =
Task
.FromResult(false);
15
public static readonly Task<int> DoneTaskZero =
Task
.FromResult(0);
17
public static bool IsSuccess(this
Task
task) {
21
public static
Task
CallVoidFuncWhenFinish(this
Task
task, Action func) {
31
private static async
Task
_CallVoidFuncWhenFinish(this
Task
task, Action func) {
36
public static Task<bool> ReturnTaskBoolWhenFinish(this
Task
task, bool ret) {
48
public static async Task<bool> _ReturnTaskBoolWhenFinish(this
Task
task, bool ret) {
53
public static
Task
CallTaskFuncWhenFinish(this
Task
task, Func<
Task
> func) {
62
private static async
Task
_CallTaskFuncWhenFinish(
Task
task, Func<
Task
> func) {
67
public static Task<bool> CallBoolTaskFuncWhenFinish(this
Task
task, Func<Task<bool>> func) {
76
private static async Task<bool> _CallBoolTaskFuncWhenFinish(this
Task
task, Func<Task<bool>> func) {
System\Xml\Base64EncoderAsync.cs (5)
11
internal abstract
Task
WriteCharsAsync(char[] chars, int index, int count);
13
internal async
Task
EncodeAsync( byte[] buffer, int index, int count ) {
72
internal async
Task
FlushAsync() {
82
internal override
Task
WriteCharsAsync(char[] chars, int index, int count) {
89
internal override
Task
WriteCharsAsync( char[] chars, int index, int count ) {
System\Xml\BinaryXml\XmlBinaryReaderAsync.cs (1)
74
public override
Task
SkipAsync() {
System\Xml\BinHexEncoderAsync.cs (1)
7
internal static async
Task
EncodeAsync( byte[] buffer, int index, int count, XmlWriter writer ) {
System\Xml\Core\IDtdParserAdapterAsync.cs (2)
24
Task
ParsePIAsync( BufferBuilder sb );
25
Task
ParseCommentAsync( BufferBuilder sb );
System\Xml\Core\ReadContentAsBinaryHelperAsync.cs (1)
200
internal async
Task
FinishAsync() {
System\Xml\Core\XmlAsyncCheckReader.cs (3)
12
private
Task
lastTask = AsyncHelper.DoneTask;
716
public override
Task
SkipAsync() {
718
var
task = coreReader.SkipAsync();
System\Xml\Core\XmlAsyncCheckWriter.cs (59)
13
private
Task
lastTask = AsyncHelper.DoneTask;
290
public override
Task
WriteStartDocumentAsync() {
292
var
task = coreWriter.WriteStartDocumentAsync();
297
public override
Task
WriteStartDocumentAsync(bool standalone) {
299
var
task = coreWriter.WriteStartDocumentAsync(standalone);
304
public override
Task
WriteEndDocumentAsync() {
306
var
task = coreWriter.WriteEndDocumentAsync();
311
public override
Task
WriteDocTypeAsync(string name, string pubid, string sysid, string subset) {
313
var
task = coreWriter.WriteDocTypeAsync(name, pubid, sysid, subset);
318
public override
Task
WriteStartElementAsync(string prefix, string localName, string ns) {
320
var
task = coreWriter.WriteStartElementAsync(prefix, localName, ns);
325
public override
Task
WriteEndElementAsync() {
327
var
task = coreWriter.WriteEndElementAsync();
332
public override
Task
WriteFullEndElementAsync() {
334
var
task = coreWriter.WriteFullEndElementAsync();
339
protected internal override
Task
WriteStartAttributeAsync(string prefix, string localName, string ns) {
341
var
task = coreWriter.WriteStartAttributeAsync(prefix, localName, ns);
346
protected internal override
Task
WriteEndAttributeAsync() {
348
var
task = coreWriter.WriteEndAttributeAsync();
353
public override
Task
WriteCDataAsync(string text) {
355
var
task = coreWriter.WriteCDataAsync(text);
360
public override
Task
WriteCommentAsync(string text) {
362
var
task = coreWriter.WriteCommentAsync(text);
367
public override
Task
WriteProcessingInstructionAsync(string name, string text) {
369
var
task = coreWriter.WriteProcessingInstructionAsync(name, text);
374
public override
Task
WriteEntityRefAsync(string name) {
376
var
task = coreWriter.WriteEntityRefAsync(name);
381
public override
Task
WriteCharEntityAsync(char ch) {
383
var
task = coreWriter.WriteCharEntityAsync(ch);
388
public override
Task
WriteWhitespaceAsync(string ws) {
390
var
task = coreWriter.WriteWhitespaceAsync(ws);
395
public override
Task
WriteStringAsync(string text) {
397
var
task = coreWriter.WriteStringAsync(text);
402
public override
Task
WriteSurrogateCharEntityAsync(char lowChar, char highChar) {
404
var
task = coreWriter.WriteSurrogateCharEntityAsync(lowChar, highChar);
409
public override
Task
WriteCharsAsync(char[] buffer, int index, int count) {
411
var
task = coreWriter.WriteCharsAsync(buffer, index, count);
416
public override
Task
WriteRawAsync(char[] buffer, int index, int count) {
418
var
task = coreWriter.WriteRawAsync(buffer, index, count);
423
public override
Task
WriteRawAsync(string data) {
425
var
task = coreWriter.WriteRawAsync(data);
430
public override
Task
WriteBase64Async(byte[] buffer, int index, int count) {
432
var
task = coreWriter.WriteBase64Async(buffer, index, count);
437
public override
Task
WriteBinHexAsync(byte[] buffer, int index, int count) {
439
var
task = coreWriter.WriteBinHexAsync(buffer, index, count);
444
public override
Task
FlushAsync() {
446
var
task = coreWriter.FlushAsync();
451
public override
Task
WriteNmTokenAsync(string name) {
453
var
task = coreWriter.WriteNmTokenAsync(name);
458
public override
Task
WriteNameAsync(string name) {
460
var
task = coreWriter.WriteNameAsync(name);
465
public override
Task
WriteQualifiedNameAsync(string localName, string ns) {
467
var
task = coreWriter.WriteQualifiedNameAsync(localName, ns);
472
public override
Task
WriteAttributesAsync(XmlReader reader, bool defattr) {
474
var
task = coreWriter.WriteAttributesAsync(reader, defattr);
479
public override
Task
WriteNodeAsync(XmlReader reader, bool defattr) {
481
var
task = coreWriter.WriteNodeAsync(reader, defattr);
487
public override
Task
WriteNodeAsync(XPathNavigator navigator, bool defattr) {
489
var
task = coreWriter.WriteNodeAsync(navigator, defattr);
System\Xml\Core\XmlCharCheckingReaderAsync.cs (1)
354
private async
Task
FinishReadBinaryAsync() {
System\Xml\Core\XmlCharCheckingWriterAsync.cs (14)
18
public override
Task
WriteDocTypeAsync( string name, string pubid, string sysid, string subset ) {
44
public override
Task
WriteStartElementAsync( string prefix, string localName, string ns ) {
58
protected internal override
Task
WriteStartAttributeAsync( string prefix, string localName, string ns ) {
72
public override async
Task
WriteCDataAsync( string text ) {
89
public override
Task
WriteCommentAsync( string text ) {
102
public override
Task
WriteProcessingInstructionAsync( string name, string text ) {
118
public override
Task
WriteEntityRefAsync( string name ) {
125
public override
Task
WriteWhitespaceAsync( string ws ) {
142
public override
Task
WriteStringAsync( string text ) {
154
public override
Task
WriteSurrogateCharEntityAsync( char lowChar, char highChar ) {
158
public override
Task
WriteCharsAsync( char[] buffer, int index, int count ) {
184
public override
Task
WriteNmTokenAsync( string name ) {
194
public override
Task
WriteNameAsync( string name ) {
201
public override
Task
WriteQualifiedNameAsync( string localName, string ns ) {
System\Xml\Core\XmlEncodedRawTextWriterAsync.cs (58)
26
internal override async
Task
WriteXmlDeclarationAsync( XmlStandalone standalone ) {
54
internal override
Task
WriteXmlDeclarationAsync( string xmldecl ) {
66
public override async
Task
WriteDocTypeAsync( string name, string pubid, string sysid, string subset ) {
102
public override
Task
WriteStartElementAsync( string prefix, string localName, string ns) {
108
Task
task;
125
internal override
Task
WriteEndElementAsync(string prefix, string localName, string ns) {
156
internal override
Task
WriteFullEndElementAsync(string prefix, string localName, string ns) {
175
protected internal override
Task
WriteStartAttributeAsync( string prefix, string localName, string ns ) {
185
Task
task;
202
protected internal override
Task
WriteEndAttributeAsync() {
212
internal override async
Task
WriteNamespaceDeclarationAsync( string prefix, string namespaceName ) {
221
internal override async
Task
WriteStartNamespaceDeclarationAsync(string prefix) {
250
internal override
Task
WriteEndNamespaceDeclarationAsync() {
264
public override async
Task
WriteCDataAsync( string text ) {
299
public override async
Task
WriteCommentAsync( string text ) {
318
public override async
Task
WriteProcessingInstructionAsync( string name, string text ) {
339
public override async
Task
WriteEntityRefAsync( string name ) {
357
public override async
Task
WriteCharEntityAsync( char ch ) {
383
public override
Task
WriteWhitespaceAsync( string ws ) {
399
public override
Task
WriteStringAsync( string text ) {
414
public override async
Task
WriteSurrogateCharEntityAsync( char lowChar, char highChar ) {
430
public override
Task
WriteCharsAsync( char[] buffer, int index, int count ) {
450
public override async
Task
WriteRawAsync( char[] buffer, int index, int count ) {
465
public override async
Task
WriteRawAsync( string data ) {
477
public override async
Task
FlushAsync() {
495
protected virtual async
Task
FlushBufferAsync() {
546
private async
Task
EncodeCharsAsync( int startOffset, int endOffset, bool writeAllToStream ) {
569
private
Task
FlushEncoderAsync() {
712
protected async
Task
WriteAttributeTextBlockAsync(char[] chars, int index, int count ) {
726
protected
Task
WriteAttributeTextBlockAsync(string text) {
742
private async
Task
_WriteAttributeTextBlockAsync(string text, int curIndex, int leftCount) {
890
protected async
Task
WriteElementTextBlockAsync(char[] chars, int index, int count ) {
913
protected
Task
WriteElementTextBlockAsync(string text) {
932
private async
Task
_WriteElementTextBlockAsync(bool newLine, string text, int curIndex, int leftCount) {
1020
protected
Task
RawTextAsync(string text) {
1035
private async
Task
_RawTextAsync(string text, int curIndex, int leftCount) {
1166
protected async
Task
WriteRawWithCharCheckingAsync(char[] chars, int index, int count ) {
1188
protected async
Task
WriteRawWithCharCheckingAsync(string text ) {
1337
protected async
Task
WriteCommentOrPiAsync(string text, int stopChar) {
1492
protected async
Task
WriteCDataSectionAsync(string text) {
1527
public override async
Task
WriteDocTypeAsync( string name, string pubid, string sysid, string subset ) {
1536
public override async
Task
WriteStartElementAsync( string prefix, string localName, string ns ) {
1550
internal override async
Task
WriteEndElementAsync(string prefix, string localName, string ns) {
1565
internal override async
Task
WriteFullEndElementAsync(string prefix, string localName, string ns) {
1581
protected internal override async
Task
WriteStartAttributeAsync( string prefix, string localName, string ns ) {
1591
public override
Task
WriteCDataAsync( string text ) {
1597
public override async
Task
WriteCommentAsync( string text ) {
1606
public override async
Task
WriteProcessingInstructionAsync( string target, string text ) {
1615
public override
Task
WriteEntityRefAsync( string name ) {
1621
public override
Task
WriteCharEntityAsync( char ch ) {
1627
public override
Task
WriteSurrogateCharEntityAsync( char lowChar, char highChar ) {
1633
public override
Task
WriteWhitespaceAsync( string ws ) {
1639
public override
Task
WriteStringAsync( string text ) {
1645
public override
Task
WriteCharsAsync( char[] buffer, int index, int count ) {
1651
public override
Task
WriteRawAsync( char[] buffer, int index, int count ) {
1657
public override
Task
WriteRawAsync( string data ) {
1663
public override
Task
WriteBase64Async( byte[] buffer, int index, int count ) {
1670
private async
Task
WriteIndentAsync() {
System\Xml\Core\XmlRawWriterAsync.cs (30)
47
public override
Task
WriteStartDocumentAsync() {
51
public override
Task
WriteStartDocumentAsync(bool standalone) {
55
public override
Task
WriteEndDocumentAsync() {
60
public override
Task
WriteDocTypeAsync(string name, string pubid, string sysid, string subset) {
68
public override
Task
WriteEndElementAsync() {
73
public override
Task
WriteFullEndElementAsync() {
78
public override
Task
WriteBase64Async( byte[] buffer, int index, int count ) {
87
public override
Task
WriteNmTokenAsync( string name ) {
92
public override
Task
WriteNameAsync( string name ) {
97
public override
Task
WriteQualifiedNameAsync( string localName, string ns ) {
103
public override
Task
WriteCDataAsync( string text ) {
108
public override
Task
WriteCharEntityAsync( char ch ) {
113
public override
Task
WriteSurrogateCharEntityAsync( char lowChar, char highChar ) {
118
public override
Task
WriteWhitespaceAsync( string ws ) {
123
public override
Task
WriteCharsAsync( char[] buffer, int index, int count ) {
128
public override
Task
WriteRawAsync(char[] buffer, int index, int count) {
133
public override
Task
WriteRawAsync(string data) {
139
public override
Task
WriteAttributesAsync( XmlReader reader, bool defattr ) {
143
public override
Task
WriteNodeAsync( XmlReader reader, bool defattr ) {
148
public override
Task
WriteNodeAsync( System.Xml.XPath.XPathNavigator navigator, bool defattr ) {
159
internal virtual
Task
WriteXmlDeclarationAsync( XmlStandalone standalone ) {
164
internal virtual
Task
WriteXmlDeclarationAsync( string xmldecl ) {
184
internal virtual
Task
StartElementContentAsync() {
192
internal virtual
Task
WriteEndElementAsync( string prefix, string localName, string ns ) {
197
internal virtual
Task
WriteFullEndElementAsync( string prefix, string localName, string ns ) {
208
internal virtual async
Task
WriteQualifiedNameAsync( string prefix, string localName, string ns ) {
218
internal virtual
Task
WriteNamespaceDeclarationAsync( string prefix, string ns ) {
222
internal virtual
Task
WriteStartNamespaceDeclarationAsync(string prefix) {
226
internal virtual
Task
WriteEndNamespaceDeclarationAsync() {
231
internal virtual
Task
WriteEndBase64Async() {
System\Xml\Core\XmlReaderAsync.cs (3)
120
public virtual
Task
SkipAsync() {
207
private async
Task
WriteNodeAsync(XmlWriter xtw, bool defattr) {
379
private
Task
FinishReadElementContentAsXxxAsync() {
System\Xml\Core\XmlSubtreeReaderAsync.cs (5)
17
return
Task
.FromResult(curNode.value);
89
public override async
Task
SkipAsync() {
443
return
Task
.FromResult(0);
458
return
Task
.FromResult(copyCount);
479
return
Task
.FromResult(0);
System\Xml\Core\XmlTextReaderImplAsync.cs (54)
42
return
Task
.FromResult(curNode.StringValue);
59
private
Task
FinishInitAsync() {
75
private async
Task
FinishInitUriStringAsync() {
108
private async
Task
FinishInitStreamAsync() {
129
private async
Task
FinishInitTextReaderAsync() {
228
return
Task
.FromResult( ParseFragmentAttribute() );
289
public override async
Task
SkipAsync() {
708
internal async
Task
DtdParserProxy_ParsePIAsync( BufferBuilder sb ) {
721
internal async
Task
DtdParserProxy_ParseCommentAsync( BufferBuilder sb ) {
816
private
Task
InitStreamInputAsync( Uri baseUri, Stream stream, Encoding encoding ) {
822
private
Task
InitStreamInputAsync( Uri baseUri, string baseUriStr, Stream stream, Encoding encoding ) {
827
private async
Task
InitStreamInputAsync( Uri baseUri, string baseUriStr, Stream stream, byte[] bytes, int byteCount, Encoding encoding ) {
901
private
Task
InitTextReaderInputAsync( string baseUriStr, TextReader input ) {
905
private
Task
InitTextReaderInputAsync( string baseUriStr, Uri baseUri, TextReader input ) {
936
private
Task
ProcessDtdFromParserContextAsync(XmlParserContext context) {
959
private
Task
SwitchEncodingAsync( Encoding newEncoding ) {
976
private
Task
SwitchEncodingToUTF8Async() {
1703
private
Task
ParseElementAsync() {
1785
private
Task
ParseElementAsync_ContinueWithSetElement(Task<Tuple<int,int>> task) {
1797
private async
Task
_ParseElementAsync_ContinueWithSetElement(Task<Tuple<int, int>> task) {
1804
private
Task
ParseElementAsync_SetElement(int colonPos, int pos) {
1856
private
Task
ParseElementAsync_NoAttributes() {
1897
private async
Task
ParseElementAsync_ReadData(int pos) {
1905
private
Task
ParseEndElementAsync() {
1918
private async
Task
_ParseEndElmentAsync() {
1923
private async
Task
ParseEndElmentAsync_PrepareData() {
1938
private
Task
ParseEndElementAsync_CheckNameAndParse() {
1972
private
Task
ParseEndElementAsync_Finish(int nameLen, NodeData startTagNode, LineInfo endTagLineInfo) {
1973
Task
task = ParseEndElementAsync_CheckEndTag(nameLen, startTagNode, endTagLineInfo);
1993
private async
Task
ParseEndElementAsync_Finish(
Task
task, int nameLen, NodeData startTagNode, LineInfo endTagLineInfo) {
2010
private
Task
ParseEndElementAsync_CheckEndTag(int nameLen, NodeData startTagNode, LineInfo endTagLineInfo) {
2098
private async
Task
ParseEndElementAsync_ReadData() {
2106
private async
Task
ThrowTagMismatchAsync( NodeData startTag ) {
2130
private async
Task
ParseAttributesAsync() {
2433
private async
Task
ParseAttributeValueSlowAsync( int curPos, char quoteChar, NodeData attr ) {
2955
private Task<Tuple<int, int, int, bool>> parseText_dummyTask =
Task
.FromResult(new Tuple<int, int, int, bool>(0,0,0,false));
3269
return
Task
.FromResult(new Tuple<int, int, int, bool>(pos, pos, outOrChars, true));
3281
return
Task
.FromResult(new Tuple<int, int, int, bool>(startPos, endPos, outOrChars, c == '<'));
3286
async
Task
FinishPartialValueAsync() {
3319
async
Task
FinishOtherValueIteratorAsync() {
3359
async
Task
SkipPartialTextValueAsync() {
3379
Task
FinishReadValueChunkAsync() {
3396
async
Task
FinishReadContentAsBinaryAsync() {
3413
async
Task
FinishReadElementContentAsBinaryAsync() {
3457
private async
Task
ParseEntityReferenceAsync() {
3891
private
Task
ParseCDataAsync() {
3896
private async
Task
ParseCDataOrCommentAsync( XmlNodeType type ) {
4142
private async
Task
ParseDtdAsync() {
4159
private async
Task
SkipDtdAsync() {
4253
Task
SkipPublicOrSystemIdLiteralAsync() {
4264
async
Task
SkipUntilAsync( char stopChar, bool recognizeLiterals ) {
4739
private async
Task
PushExternalEntityOrSubsetAsync(string publicId, string systemId, Uri baseUri, string entityName) {
4885
private async
Task
ParseDtdFromParserContextAsync() {
System\Xml\Core\XmlTextReaderImplHelpersAsync.cs (2)
48
Task
IDtdParserAdapter.ParsePIAsync( BufferBuilder sb ) {
52
Task
IDtdParserAdapter.ParseCommentAsync( BufferBuilder sb ) {
System\Xml\Core\XmlUtf8RawTextWriterAsync.cs (57)
26
internal override async
Task
WriteXmlDeclarationAsync( XmlStandalone standalone ) {
52
internal override
Task
WriteXmlDeclarationAsync( string xmldecl ) {
64
public override async
Task
WriteDocTypeAsync( string name, string pubid, string sysid, string subset ) {
98
public override
Task
WriteStartElementAsync( string prefix, string localName, string ns) {
104
Task
task;
121
internal override
Task
WriteEndElementAsync( string prefix, string localName, string ns ) {
149
internal override
Task
WriteFullEndElementAsync( string prefix, string localName, string ns ) {
166
protected internal override
Task
WriteStartAttributeAsync(string prefix, string localName, string ns) {
174
Task
task;
189
protected internal override
Task
WriteEndAttributeAsync() {
200
internal override async
Task
WriteNamespaceDeclarationAsync( string prefix, string namespaceName ) {
209
internal override async
Task
WriteStartNamespaceDeclarationAsync(string prefix) {
236
internal override
Task
WriteEndNamespaceDeclarationAsync() {
250
public override async
Task
WriteCDataAsync( string text ) {
283
public override async
Task
WriteCommentAsync( string text ) {
300
public override async
Task
WriteProcessingInstructionAsync( string name, string text ) {
319
public override async
Task
WriteEntityRefAsync( string name ) {
335
public override async
Task
WriteCharEntityAsync( char ch ) {
359
public override
Task
WriteWhitespaceAsync( string ws ) {
374
public override
Task
WriteStringAsync( string text ) {
388
public override async
Task
WriteSurrogateCharEntityAsync( char lowChar, char highChar ) {
404
public override
Task
WriteCharsAsync( char[] buffer, int index, int count ) {
422
public override async
Task
WriteRawAsync( char[] buffer, int index, int count ) {
435
public override async
Task
WriteRawAsync( string data ) {
445
public override async
Task
FlushAsync() {
460
protected virtual async
Task
FlushBufferAsync() {
497
private
Task
FlushEncoderAsync() {
630
protected async
Task
WriteAttributeTextBlockAsync(char[] chars, int index, int count) {
644
protected
Task
WriteAttributeTextBlockAsync(string text) {
659
private async
Task
_WriteAttributeTextBlockAsync(string text, int curIndex, int leftCount) {
807
protected async
Task
WriteElementTextBlockAsync(char[] chars, int index, int count ) {
830
protected
Task
WriteElementTextBlockAsync(string text) {
849
private async
Task
_WriteElementTextBlockAsync(bool newLine, string text, int curIndex, int leftCount) {
937
protected
Task
RawTextAsync(string text) {
952
private async
Task
_RawTextAsync(string text, int curIndex, int leftCount) {
1083
protected async
Task
WriteRawWithCharCheckingAsync(char[] chars, int index, int count ) {
1105
protected async
Task
WriteRawWithCharCheckingAsync(string text ) {
1254
protected async
Task
WriteCommentOrPiAsync(string text, int stopChar) {
1409
protected async
Task
WriteCDataSectionAsync(string text) {
1444
public override async
Task
WriteDocTypeAsync( string name, string pubid, string sysid, string subset ) {
1453
public override async
Task
WriteStartElementAsync( string prefix, string localName, string ns ) {
1467
internal override async
Task
WriteEndElementAsync(string prefix, string localName, string ns) {
1482
internal override async
Task
WriteFullEndElementAsync(string prefix, string localName, string ns) {
1498
protected internal override async
Task
WriteStartAttributeAsync( string prefix, string localName, string ns ) {
1508
public override
Task
WriteCDataAsync( string text ) {
1514
public override async
Task
WriteCommentAsync( string text ) {
1523
public override async
Task
WriteProcessingInstructionAsync( string target, string text ) {
1532
public override
Task
WriteEntityRefAsync( string name ) {
1538
public override
Task
WriteCharEntityAsync( char ch ) {
1544
public override
Task
WriteSurrogateCharEntityAsync( char lowChar, char highChar ) {
1550
public override
Task
WriteWhitespaceAsync( string ws ) {
1556
public override
Task
WriteStringAsync( string text ) {
1562
public override
Task
WriteCharsAsync( char[] buffer, int index, int count ) {
1568
public override
Task
WriteRawAsync( char[] buffer, int index, int count ) {
1574
public override
Task
WriteRawAsync( string data ) {
1580
public override
Task
WriteBase64Async( byte[] buffer, int index, int count ) {
1587
private async
Task
WriteIndentAsync() {
System\Xml\Core\XmlValidatingReaderImplAsync.cs (3)
151
internal async
Task
MoveOffEntityReferenceAsync() {
211
private async
Task
ParseDtdFromParserContextAsync()
228
private async
Task
ResolveEntityInternallyAsync() {
System\Xml\Core\XmlWellFormedWriterAsync.cs (75)
20
public override
Task
WriteStartDocumentAsync() {
24
public override
Task
WriteStartDocumentAsync(bool standalone) {
28
public override async
Task
WriteEndDocumentAsync() {
50
public override async
Task
WriteDocTypeAsync(string name, string pubid, string sysid, string subset) {
104
private
Task
TryReturnTask(
Task
task) {
113
private async
Task
_TryReturnTask(
Task
task) {
124
private
Task
SequenceRun(
Task
task, Func<
Task
> nextTaskFun) {
133
private async
Task
_SequenceRun(
Task
task, Func<
Task
> nextTaskFun) {
144
public override
Task
WriteStartElementAsync(string prefix, string localName, string ns) {
152
Task
task = AdvanceStateAsync(Token.StartElement);
166
private
Task
WriteStartElementAsync_NoAdvanceState(string prefix, string localName, string ns) {
200
Task
task = writer.WriteStartElementAsync(prefix, localName, ns);
215
private async
Task
WriteStartElementAsync_NoAdvanceState(
Task
task, string prefix, string localName, string ns) {
250
private async
Task
WriteStartElementAsync_FinishWrite(
Task
t, string prefix, string localName, string ns) {
261
public override
Task
WriteEndElementAsync() {
263
Task
task = AdvanceStateAsync(Token.EndElement);
273
private
Task
WriteEndElementAsync_NoAdvanceState() {
279
Task
task;
296
private
Task
WriteEndElementAsync_FinishWrite() {
324
public override
Task
WriteFullEndElementAsync() {
326
Task
task = AdvanceStateAsync(Token.EndElement);
336
private
Task
WriteFullEndElementAsync_NoAdvanceState() {
342
Task
task;
359
protected internal override
Task
WriteStartAttributeAsync(string prefix, string localName, string namespaceName) {
373
Task
task = AdvanceStateAsync(Token.StartAttribute);
387
private
Task
WriteStartAttributeAsync_NoAdvanceState(string prefix, string localName, string namespaceName) {
485
private async
Task
WriteStartAttributeAsync_NoAdvanceState(
Task
task, string prefix, string localName, string namespaceName) {
497
protected internal override
Task
WriteEndAttributeAsync() {
499
Task
task = AdvanceStateAsync(Token.EndAttribute);
508
private
Task
WriteEndAttributeAsync_NoAdvance() {
524
private async
Task
WriteEndAttributeAsync_SepcialAtt() {
612
public override async
Task
WriteCDataAsync(string text) {
626
public override async
Task
WriteCommentAsync(string text) {
640
public override async
Task
WriteProcessingInstructionAsync(string name, string text) {
681
public override async
Task
WriteEntityRefAsync(string name) {
703
public override async
Task
WriteCharEntityAsync(char ch) {
723
public override async
Task
WriteSurrogateCharEntityAsync(char lowChar, char highChar) {
743
public override async
Task
WriteWhitespaceAsync(string ws) {
766
public override
Task
WriteStringAsync(string text) {
772
Task
task = AdvanceStateAsync(Token.Text);
787
private
Task
WriteStringAsync_NoAdvanceState(string text) {
804
private async
Task
WriteStringAsync_NoAdvanceState(
Task
task, string text) {
815
public override async
Task
WriteCharsAsync(char[] buffer, int index, int count) {
844
public override async
Task
WriteRawAsync(char[] buffer, int index, int count) {
873
public override async
Task
WriteRawAsync(string data) {
893
public override
Task
WriteBase64Async(byte[] buffer, int index, int count) {
908
Task
task = AdvanceStateAsync(Token.Base64);
924
private async
Task
WriteBase64Async_NoAdvanceState(
Task
task, byte[] buffer, int index, int count) {
936
public override async
Task
FlushAsync() {
946
public override async
Task
WriteQualifiedNameAsync(string localName, string ns) {
984
public override async
Task
WriteBinHexAsync(byte[] buffer, int index, int count) {
998
private async
Task
WriteStartDocumentImplAsync(XmlStandalone standalone) {
1027
private
Task
AdvanceStateAsync_ReturnWhenFinish(
Task
task, State newState) {
1037
private async
Task
_AdvanceStateAsync_ReturnWhenFinish(
Task
task, State newState) {
1042
private
Task
AdvanceStateAsync_ContinueWhenFinish(
Task
task, State newState, Token token) {
1052
private async
Task
_AdvanceStateAsync_ContinueWhenFinish(
Task
task, State newState, Token token) {
1059
private
Task
AdvanceStateAsync(Token token) {
1072
Task
task;
1159
private async
Task
StartElementContentAsync_WithNS() {
1171
private
Task
StartElementContentAsync() {
System\Xml\Core\XmlWellFormedWriterHelpersAsync.cs (4)
15
internal
Task
WriteEndElementAsync(XmlRawWriter rawWriter) {
19
internal
Task
WriteFullEndElementAsync(XmlRawWriter rawWriter) {
26
internal async
Task
WriteDeclAsync(XmlWriter writer, XmlRawWriter rawWriter) {
46
internal async
Task
ReplayAsync(XmlWriter writer) {
System\Xml\Core\XmlWrappingReaderAsync.cs (1)
22
public override
Task
SkipAsync() {
System\Xml\Core\XmlWrappingWriterAsync.cs (22)
14
public override
Task
WriteStartDocumentAsync() {
18
public override
Task
WriteStartDocumentAsync(bool standalone) {
22
public override
Task
WriteEndDocumentAsync() {
26
public override
Task
WriteDocTypeAsync(string name, string pubid, string sysid, string subset) {
30
public override
Task
WriteStartElementAsync(string prefix, string localName, string ns) {
34
public override
Task
WriteEndElementAsync() {
38
public override
Task
WriteFullEndElementAsync() {
42
protected internal override
Task
WriteStartAttributeAsync(string prefix, string localName, string ns) {
46
protected internal override
Task
WriteEndAttributeAsync() {
50
public override
Task
WriteCDataAsync(string text) {
54
public override
Task
WriteCommentAsync(string text) {
58
public override
Task
WriteProcessingInstructionAsync(string name, string text) {
62
public override
Task
WriteEntityRefAsync(string name) {
66
public override
Task
WriteCharEntityAsync(char ch) {
70
public override
Task
WriteWhitespaceAsync(string ws) {
74
public override
Task
WriteStringAsync(string text) {
78
public override
Task
WriteSurrogateCharEntityAsync(char lowChar, char highChar) {
82
public override
Task
WriteCharsAsync(char[] buffer, int index, int count) {
86
public override
Task
WriteRawAsync(char[] buffer, int index, int count) {
90
public override
Task
WriteRawAsync(string data) {
94
public override
Task
WriteBase64Async(byte[] buffer, int index, int count) {
98
public override
Task
FlushAsync() {
System\Xml\Core\XmlWriterAsync.cs (37)
25
public virtual
Task
WriteStartDocumentAsync() {
31
public virtual
Task
WriteStartDocumentAsync(bool standalone) {
37
public virtual
Task
WriteEndDocumentAsync() {
43
public virtual
Task
WriteDocTypeAsync(string name, string pubid, string sysid, string subset) {
49
public virtual
Task
WriteStartElementAsync(string prefix, string localName, string ns) {
55
public virtual
Task
WriteEndElementAsync() {
61
public virtual
Task
WriteFullEndElementAsync() {
69
public
Task
WriteAttributeStringAsync(string prefix, string localName, string ns, string value) {
70
Task
task = WriteStartAttributeAsync(prefix, localName, ns);
79
private async
Task
WriteAttributeStringAsyncHelper(
Task
task, string value) {
87
protected internal virtual
Task
WriteStartAttributeAsync(string prefix, string localName, string ns) {
93
protected internal virtual
Task
WriteEndAttributeAsync() {
99
public virtual
Task
WriteCDataAsync(string text) {
105
public virtual
Task
WriteCommentAsync(string text) {
111
public virtual
Task
WriteProcessingInstructionAsync(string name, string text) {
117
public virtual
Task
WriteEntityRefAsync(string name) {
123
public virtual
Task
WriteCharEntityAsync(char ch) {
129
public virtual
Task
WriteWhitespaceAsync(string ws) {
135
public virtual
Task
WriteStringAsync(string text) {
141
public virtual
Task
WriteSurrogateCharEntityAsync(char lowChar, char highChar) {
147
public virtual
Task
WriteCharsAsync(char[] buffer, int index, int count) {
153
public virtual
Task
WriteRawAsync(char[] buffer, int index, int count) {
159
public virtual
Task
WriteRawAsync(string data) {
165
public virtual
Task
WriteBase64Async(byte[] buffer, int index, int count) {
170
public virtual
Task
WriteBinHexAsync(byte[] buffer, int index, int count) {
176
public virtual
Task
FlushAsync() {
184
public virtual
Task
WriteNmTokenAsync(string name) {
193
public virtual
Task
WriteNameAsync(string name) {
198
public virtual async
Task
WriteQualifiedNameAsync(string localName, string ns) {
213
public virtual async
Task
WriteAttributesAsync(XmlReader reader, bool defattr) {
250
public virtual
Task
WriteNodeAsync(XmlReader reader, bool defattr) {
267
internal async
Task
WriteNodeAsync_CallSyncReader(XmlReader reader, bool defattr) {
327
internal async
Task
WriteNodeAsync_CallAsyncReader(XmlReader reader, bool defattr) {
385
public virtual async
Task
WriteNodeAsync(XPathNavigator navigator, bool defattr) {
495
public async
Task
WriteElementStringAsync(string prefix, String localName, String ns, String value) {
506
private async
Task
WriteLocalNamespacesAsync(XPathNavigator nsNav) {
System\Xml\Core\XsdCachingReaderAsync.cs (4)
20
return
Task
.FromResult(cachedNode.OriginalStringValue);
23
return
Task
.FromResult(cachedNode.RawValue);
94
public override async
Task
SkipAsync() {
120
internal
Task
SetToReplayModeAsync() {
System\Xml\Core\XsdValidatingReaderAsync.cs (9)
22
return
Task
.FromResult(cachedNode.RawValue);
208
private Task<bool> ReadAsync_ReadAhead(
Task
task) {
218
private async Task<bool> _ReadAsync_ReadAhead(
Task
task) {
250
Task
task = ProcessReaderEventAsync();
276
public override async
Task
SkipAsync() {
397
private
Task
ProcessReaderEventAsync() {
447
private async
Task
ProcessElementEventAsync() {
511
private async
Task
ProcessEndElementEventAsync() {
528
private async
Task
ProcessInlineSchemaAsync() {
System\Xml\Resolvers\XmlPreloadedResolverAsync.cs (2)
38
return
Task
.FromResult<Object>(data.AsStream());
41
return
Task
.FromResult<Object>(data.AsTextReader());
System\Xml\Schema\DtdParserAsync.cs (22)
45
private async
Task
ParseAsync( bool saveInternalSubset ) {
69
private async
Task
ParseInDocumentDtdAsync( bool saveInternalSubset ) {
113
private async
Task
ParseFreeFloatingDtdAsync() {
125
private
Task
ParseInternalSubsetAsync() {
130
private async
Task
ParseExternalSubsetAsync() {
155
private async
Task
ParseSubsetAsync() {
263
private async
Task
ParseAttlistDeclAsync() {
358
private async
Task
ParseAttlistTypeAsync( SchemaAttDef attrDef, SchemaElementDecl elementDecl, bool ignoreErrors ) {
479
private async
Task
ParseAttlistDefaultAsync( SchemaAttDef attrDef, bool ignoreErrors ) {
524
private async
Task
ParseElementDeclAsync() {
736
private async
Task
ParseElementOnlyContentAsync( ParticleContentValidator pcv, int startParenEntityId ) {
818
private async
Task
ParseHowManyAsync( ParticleContentValidator pcv ) {
834
private async
Task
ParseElementMixedContentAsync( ParticleContentValidator pcv, int startParenEntityId ) {
892
private async
Task
ParseEntityDeclAsync() {
983
private async
Task
ParseNotationDeclAsync() {
1032
private async
Task
ParseCommentAsync() {
1058
private async
Task
ParsePIAsync() {
1070
private async
Task
ParseCondSectionAsync() {
2246
private
Task
ScanNameAsync() {
2250
private
Task
ScanQNameAsync() {
2254
private async
Task
ScanQNameAsync( bool isQName ) {
2356
private async
Task
ScanNmtokenAsync() {
System\Xml\Schema\ParserAsync.cs (1)
21
public async
Task
StartParsingAsync(XmlReader reader, string targetNamespace) {
System\Xml\XmlDownloadManagerAsync.cs (1)
23
return
Task
.Run<Stream>(() => { return new FileStream(uri.LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read, 1, true); });
WindowsBase (3)
Base\System\Windows\Threading\DispatcherOperation.cs (1)
162
public
Task
Task
Base\System\Windows\Threading\DispatcherOperationTaskSource.cs (2)
12
public abstract
Task
GetTask();
32
public override
Task
GetTask()