164 references to Task
mscorlib (13)
system\threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (3)
152get { return EnsureCompletionStateInitialized().Task; } 219Contract.Assert(!localCs.Task.IsCompleted, "Completion should only happen once."); 723if (m_completionState != null && m_completionState.Task.IsCompleted) return ProcessingMode.Completed;
system\threading\Tasks\TaskCompletionSource.cs (10)
32/// delegate, providing access to the consumer side through the <see cref="Task"/> property. 72/// by this instance and accessible through its <see cref="Task"/> property 159/// <exception cref="T:System.ObjectDisposedException">The <see cref="Task"/> was disposed.</exception> 188/// <exception cref="T:System.ObjectDisposedException">The <see cref="Task"/> was disposed.</exception> 241/// <exception cref="T:System.ObjectDisposedException">The <see cref="Task"/> was disposed.</exception> 269/// <exception cref="T:System.ObjectDisposedException">The <see cref="Task"/> was disposed.</exception> 295/// <exception cref="T:System.ObjectDisposedException">The <see cref="Task"/> was disposed.</exception> 318/// <exception cref="T:System.ObjectDisposedException">The <see cref="Task"/> was disposed.</exception> 339/// <exception cref="T:System.ObjectDisposedException">The <see cref="Task"/> was disposed.</exception> 366/// <exception cref="T:System.ObjectDisposedException">The <see cref="Task"/> was disposed.</exception>
System (20)
net\System\Net\mail\SmtpClient.cs (1)
747return tcs.Task;
net\System\Net\NetworkInformation\ping.cs (1)
561return tcs.Task;
net\System\Net\webclient.cs (9)
2567return tcs.Task; 2598return tcs.Task; 2643return tcs.Task; 2692return tcs.Task; 2723return tcs.Task; 2754return tcs.Task; 2803return tcs.Task; 2852return tcs.Task; 2904return tcs.Task;
net\System\Net\WebSockets\WebSocketBase.cs (2)
821closeOutputTask = m_CloseReceivedTaskCompletionSource.Task; 946await m_CloseReceivedTaskCompletionSource.Task.SuppressContextFlow();
net\System\Net\WebSockets\WebSocketConnectionStream.cs (3)
670return m_WriteTaskCompletionSource.Task; 722return m_WriteTaskCompletionSource.Task; 799return m_ReadTaskCompletionSource.Task;
net\System\Net\WebSockets\WebSocketHttpListenerDuplexStream.cs (4)
180bytesRead = await m_ReadTaskCompletionSource.Task.SuppressContextFlow<int>(); 389await m_WriteTaskCompletionSource.Task.SuppressContextFlow(); 459await m_WriteTaskCompletionSource.Task.SuppressContextFlow(); 641await m_WriteTaskCompletionSource.Task.SuppressContextFlow();
System.Data (105)
fx\src\data\System\Data\Common\AdapterUtil.cs (2)
57return completion.Task; 63return completion.Task;
fx\src\data\System\Data\Common\DBConnection.cs (1)
200return taskCompletionSource.Task;
fx\src\data\System\Data\ProviderBase\DbConnectionClosed.cs (3)
115if (retry == null || !retry.Task.IsCompleted) { 125Debug.Assert(retry.Task.Status == TaskStatus.RanToCompletion, "retry task must be completed successfully"); 126DbConnectionInternal openConnection = retry.Task.Result;
fx\src\data\System\Data\ProviderBase\DbConnectionFactory.cs (2)
181s_completedTask = source.Task; 248ADP.SetCurrentTransaction(retry.Task.AsyncState as Transactions.Transaction);
fx\src\data\System\Data\ProviderBase\DbConnectionPool.cs (2)
1092if (next.Completion.Task.IsCompleted) { 1122ADP.SetCurrentTransaction(next.Completion.Task.AsyncState as Transactions.Transaction);
fx\src\data\System\Data\SqlClient\SqlBulkCopy.cs (19)
1020return tcs.Task; 1621resultTask = source.Task; 1761return tcs.Task; 2029resultTask = source.Task; 2132return tcs.Task; 2185resultTask = source.Task; 2193resultTask = source.Task; 2230Debug.Assert(source == null || !source.Task.IsCompleted, "Called into CopyBatchesAsync with a completed task!"); 2268return source.Task; 2275return source.Task; 2285return source.Task; 2295Debug.Assert(source == null || !source.Task.IsCompleted, "Called into CopyBatchesAsync with a completed task!"); 2320return source.Task; 2329return source.Task; 2340Debug.Assert(source == null || !source.Task.IsCompleted, "Called into CopyBatchesAsync with a completed task!"); 2370return source.Task; 2376return source.Task; 2589AsyncHelper.ContinueTask(cancellableReconnectTS.Task, source, 2667resultTask = source.Task;
fx\src\data\System\Data\SqlClient\SqlCommand.cs (23)
1302globalCompletion.Task.ContinueWith((t) => callback(t), TaskScheduler.Default); 1305return globalCompletion.Task; 1372Debug.Assert(_reconnectionCompletionSource == null || _reconnectionCompletionSource.Task.IsCanceled, "ReconnectCompletionSource should be null or cancelled"); 1435if (reconnectionCompletionSource != null && reconnectionCompletionSource.Task.IsCanceled) { 1795globalCompletion.Task.ContinueWith((t) => callback(t), TaskScheduler.Default); 1797return globalCompletion.Task; 2188globalCompletion.Task.ContinueWith((t) => callback(t), TaskScheduler.Default); 2191return globalCompletion.Task; 2211localCompletion.Task.ContinueWith(tsk => { 2416return source.Task; 2421Task<int> returnedTask = source.Task; 2480return source.Task; 2485Task<SqlDataReader> returnedTask = source.Task; 2565return source.Task; 2584return source.Task; 2589Task<XmlReader> returnedTask = source.Task; 3069_activeConnection.RegisterWaitingForReconnect(completion.Task); 3075if (completion.Task.IsCompleted) { 3088return completion.Task; 4309task = completion.Task; 4355_activeConnection.RegisterWaitingForReconnect(completion.Task); 4361if (completion.Task.IsCompleted) { 4375task = completion.Task;
fx\src\data\System\Data\SqlClient\SqlConnection.cs (7)
1409return result.Task; 1415return result.Task; 1425return result.Task; 1437_currentCompletion = new Tuple<TaskCompletionSource<DbConnectionInternal>, Task>(completion, result.Task); 1438completion.Task.ContinueWith(retry.Retry, TaskScheduler.Default); 1439return result.Task; 1442return result.Task;
fx\src\data\System\Data\SqlClient\SqlDataReader.cs (30)
818((IAsyncResult)networkPacketTaskSource.Task).AsyncWaitHandle.WaitOne(); 3941return source.Task; 3948return source.Task; 3953Task original = Interlocked.CompareExchange(ref _currentTask, source.Task, null); 3956return source.Task; 3963return source.Task; 4002return source.Task; 4008return source.Task; 4021Task original = Interlocked.CompareExchange(ref _currentTask, source.Task, null); 4024return source.Task; 4113Task original = Interlocked.CompareExchange(ref _currentTask, source.Task, null); 4116return source.Task; 4123return source.Task; 4173return source.Task; 4264Task original = Interlocked.CompareExchange(ref _currentTask, source.Task, null); 4267return source.Task; 4274return source.Task; 4384Task original = Interlocked.CompareExchange(ref _currentTask, source.Task, null); 4387return source.Task; 4394return source.Task; 4485Task original = Interlocked.CompareExchange(ref _currentTask, source.Task, null); 4488return source.Task; 4495return source.Task; 4572return source.Task; 4575return completionSource.Task.ContinueWith((retryTask) => { 4580return exceptionSource.Task; 4615return source.Task; 4645return source.Task; 4659Task current = Interlocked.CompareExchange(ref _currentTask, null, source.Task); 4660Debug.Assert(current == source.Task, "Should not be able to change the _currentTask while an asynchronous operation is pending");
fx\src\data\System\Data\SqlClient\SqlSequentialStream.cs (3)
166Task original = Interlocked.CompareExchange<Task>(ref _currentTask, completion.Task, null); 258Interlocked.CompareExchange(ref _currentTask, null, completion.Task); 263return completion.Task;
fx\src\data\System\Data\SqlClient\SqlSequentialTextReader.cs (3)
140Task original = Interlocked.CompareExchange<Task>(ref _currentTask, completion.Task, null); 262Interlocked.CompareExchange(ref _currentTask, null, completion.Task); 267return completion.Task;
fx\src\data\System\Data\SqlClient\SqlUtil.cs (2)
42return completion.Task; 172if (!tsk.IsCanceled && !completion.Task.IsCompleted) {
fx\src\data\System\Data\SqlClient\TdsParser.cs (2)
8541task = completion.Task; 8587task = completion.Task;
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (6)
2072if (!source.Task.IsCompleted) { 2078if ((pendingCallback == 3) && (!source.Task.IsCompleted)) { 2115Debug.Assert(_networkPacketTaskSource == null || ((_asyncReadWithoutSnapshot) && (_networkPacketTaskSource.Task.IsCompleted)), "Pending async call or failed to replay snapshot when calling ReadSni"); 2681Task task = _writeCompletionSource.Task; 2767task = completion.Task; // we only care about return from topmost call, so do not access Task property in other cases 2928task = _writeCompletionSource.Task;
System.ServiceModel (8)
System\ServiceModel\Channels\HttpPipeline.cs (1)
493return this.channelModelIntegrationHandlerTask.Task;
System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (5)
573if (this.receiveTask.Task.IsCompleted) 581this.receiveTask.Task.ContinueWith(t => 616bool waitingResult = this.receiveTask.Task.Wait(timeout); 834Fx.Assert(this.receiveTask == null || this.receiveTask.Task.IsCompleted, "this.receiveTask is not completed."); 851await this.streamWaitTask.Task.ConfigureAwait(false);
System\ServiceModel\Dispatcher\TaskMethodInvoker.cs (2)
307callbackObj(tcsObj.Task); 311return tcs.Task;
System.ServiceModel.Activation (2)
System\ServiceModel\Activation\HostedHttpContext.cs (2)
92return this.webSocketContextTaskSource.Task; 122return webSocketWaitingTask.Task;
System.ServiceModel.Discovery (2)
System\ServiceModel\Discovery\DiscoveryClient.cs (2)
440Task<FindResponse> task = taskCompletionSource.Task; 461Task<ResolveResponse> task = taskCompletionSource.Task;
System.ServiceModel.Internals (4)
System\Runtime\TaskExtensions.cs (4)
47callback(tcs.Task); 52return tcs.Task; 89callback(tcs.Task); 94return tcs.Task;
System.Web (9)
AspNetSynchronizationContextBase.cs (1)
65return tcs.Task;
Hosting\ApplicationManager.cs (1)
672return tcs.Task;
UI\PageAsyncTaskApm.cs (1)
37await taskCompletionSource.Task;
Util\CountdownTask.cs (1)
32get { return _tcs.Task; }
Util\SynchronizationHelper.cs (2)
86_lastScheduledTask = tcs.Task; // future work can be scheduled off this Task 196await tcs.Task;
WebSockets\WebSocketPipe.cs (3)
82return tcs.Task; 115return tcs.Task; 184return tcs.Task;
WindowsBase (1)
Base\System\Windows\Threading\DispatcherOperationTaskSource.cs (1)
39return _taskCompletionSource.Task;