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