summaryrefslogtreecommitdiff
path: root/src/System.Private.CoreLib/shared/System/Threading
diff options
context:
space:
mode:
authorStephen Toub <stoub@microsoft.com>2019-06-03 21:00:04 -0400
committerGitHub <noreply@github.com>2019-06-03 21:00:04 -0400
commit4638845251f0ea0a6d222b645e2d04a406dc4ab6 (patch)
treeac51ddb8fc7c3b061facf59ade6fa8265a5b13bb /src/System.Private.CoreLib/shared/System/Threading
parent70850eae561ad9dd887ce6f9cb3f2bac251de0b5 (diff)
downloadcoreclr-4638845251f0ea0a6d222b645e2d04a406dc4ab6.tar.gz
coreclr-4638845251f0ea0a6d222b645e2d04a406dc4ab6.tar.bz2
coreclr-4638845251f0ea0a6d222b645e2d04a406dc4ab6.zip
Remove unnecessary Shared<T> class from Task (#24931)
It's just StrongBox<T>.
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/Threading')
-rw-r--r--src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs b/src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs
index 4fb8d9aff9..ffe299bedb 100644
--- a/src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs
+++ b/src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs
@@ -21,19 +21,6 @@ using Internal.Runtime.CompilerServices;
namespace System.Threading.Tasks
{
/// <summary>
- /// Utility class for allocating structs as heap variables
- /// </summary>
- internal class Shared<T>
- {
- internal T Value;
-
- internal Shared(T value)
- {
- this.Value = value;
- }
- }
-
- /// <summary>
/// Represents the current stage in the lifecycle of a <see cref="Task"/>.
/// </summary>
public enum TaskStatus
@@ -250,7 +237,7 @@ namespace System.Threading.Tasks
// Cancellation fields (token, registration, and internally requested)
internal CancellationToken m_cancellationToken; // Task's cancellation token, if it has one
- internal Shared<CancellationTokenRegistration>? m_cancellationRegistration; // Task's registration with the cancellation token
+ internal StrongBox<CancellationTokenRegistration>? m_cancellationRegistration; // Task's registration with the cancellation token
internal volatile int m_internalCancellationRequested; // Its own field because multiple threads legally try to set it.
// Parenting fields
@@ -658,7 +645,7 @@ namespace System.Threading.Tasks
new Tuple<Task, Task, TaskContinuation>(this, antecedent, continuation));
}
- props.m_cancellationRegistration = new Shared<CancellationTokenRegistration>(ctr);
+ props.m_cancellationRegistration = new StrongBox<CancellationTokenRegistration>(ctr);
}
}
}