summaryrefslogtreecommitdiff
path: root/src/System.Private.CoreLib/shared/System/Threading/Tasks
diff options
context:
space:
mode:
authorAhson Khan <ahkha@microsoft.com>2018-05-21 18:03:55 -0700
committerGitHub <noreply@github.com>2018-05-21 18:03:55 -0700
commitf31097f14560b193e76a7b2e1e61af9870b5356b (patch)
tree781ac579824a68f50f00b68d293cefc9e0a2d9be /src/System.Private.CoreLib/shared/System/Threading/Tasks
parent49f6249abc44269b437064e850ad22eb9f74a446 (diff)
downloadcoreclr-f31097f14560b193e76a7b2e1e61af9870b5356b.tar.gz
coreclr-f31097f14560b193e76a7b2e1e61af9870b5356b.tar.bz2
coreclr-f31097f14560b193e76a7b2e1e61af9870b5356b.zip
Code cleanup and formatting for System.Memory files. (#17451)
* Fix IDE0034 C# expression can be simplified (use of default) * Remove unnecessary using statements * IDE0012 C# Name can be simplified. String -> string * IDE0041 C# Null check can be simplified * Fix code formatting (limited to Span/System.Memory files). * Address PR feedback - IDE0012 Name can be simplified (String -> string) * Add back the necessary using statements and fix typo * Fix comment typo and add necessary using statements
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/Threading/Tasks')
-rw-r--r--src/System.Private.CoreLib/shared/System/Threading/Tasks/ConcurrentExclusiveSchedulerPair.cs4
-rw-r--r--src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskCompletionSource.cs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Threading/Tasks/ConcurrentExclusiveSchedulerPair.cs b/src/System.Private.CoreLib/shared/System/Threading/Tasks/ConcurrentExclusiveSchedulerPair.cs
index 469535c0bb..146e477e2c 100644
--- a/src/System.Private.CoreLib/shared/System/Threading/Tasks/ConcurrentExclusiveSchedulerPair.cs
+++ b/src/System.Private.CoreLib/shared/System/Threading/Tasks/ConcurrentExclusiveSchedulerPair.cs
@@ -295,7 +295,7 @@ namespace System.Threading.Tasks
try
{
processingTask = new Task(thisPair => ((ConcurrentExclusiveSchedulerPair)thisPair).ProcessExclusiveTasks(), this,
- default(CancellationToken), GetCreationOptionsForTask(fairly));
+ default, GetCreationOptionsForTask(fairly));
processingTask.Start(m_underlyingTaskScheduler);
// When we call Start, if the underlying scheduler throws in QueueTask, TPL will fault the task and rethrow
// the exception. To deal with that, we need a reference to the task object, so that we can observe its exception.
@@ -322,7 +322,7 @@ namespace System.Threading.Tasks
try
{
processingTask = new Task(thisPair => ((ConcurrentExclusiveSchedulerPair)thisPair).ProcessConcurrentTasks(), this,
- default(CancellationToken), GetCreationOptionsForTask(fairly));
+ default, GetCreationOptionsForTask(fairly));
processingTask.Start(m_underlyingTaskScheduler); // See above logic for why we use new + Start rather than StartNew
}
catch
diff --git a/src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskCompletionSource.cs b/src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskCompletionSource.cs
index 992e9db767..11ba26d89d 100644
--- a/src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskCompletionSource.cs
+++ b/src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskCompletionSource.cs
@@ -315,7 +315,7 @@ namespace System.Threading.Tasks
/// <exception cref="T:System.ObjectDisposedException">The <see cref="Task"/> was disposed.</exception>
public bool TrySetCanceled()
{
- return TrySetCanceled(default(CancellationToken));
+ return TrySetCanceled(default);
}
// Enables a token to be stored into the canceled task