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