Extracts public IThreadPoolWorkItem interface to shared CoreLib (dotnet/coreclr#21653)
authorMarek Safar <marek.safar@gmail.com>
Sun, 23 Dec 2018 03:20:39 +0000 (04:20 +0100)
committerDan Moseley <danmose@microsoft.com>
Sun, 23 Dec 2018 03:20:39 +0000 (19:20 -0800)
Commit migrated from https://github.com/dotnet/coreclr/commit/18c33d2896ca55ca661c6ed864c0d1f2eedab170

src/coreclr/src/System.Private.CoreLib/src/System/Threading/ThreadPool.cs
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
src/libraries/System.Private.CoreLib/src/System/Threading/IThreadPoolWorkItem.cs [new file with mode: 0644]

index cf44d85..2f77425 100644 (file)
@@ -917,12 +917,6 @@ namespace System.Threading
 
     public delegate void WaitOrTimerCallback(object state, bool timedOut);  // signaled or timed out
 
-    /// <summary>Represents a work item that can be executed by the ThreadPool.</summary>
-    public interface IThreadPoolWorkItem
-    {
-        void Execute();
-    }
-
     //
     // This type is necessary because VS 2010's debugger looks for a method named _ThreadPoolWaitCallbacck.PerformWaitCallback
     // on the stack to determine if a thread is a ThreadPool thread or not.  We have a better way to do this for .NET 4.5, but
index fe69d3d..a2d8a87 100644 (file)
     <Compile Include="$(MSBuildThisFileDirectory)System\Threading\EventResetMode.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Threading\EventWaitHandle.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Threading\ExecutionContext.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)System\Threading\IThreadPoolWorkItem.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Threading\LazyInitializer.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Threading\LazyThreadSafetyMode.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Threading\LockRecursionException.cs" />
diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/IThreadPoolWorkItem.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/IThreadPoolWorkItem.cs
new file mode 100644 (file)
index 0000000..31cd991
--- /dev/null
@@ -0,0 +1,12 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Threading
+{
+    /// <summary>Represents a work item that can be executed by the ThreadPool.</summary>
+    public interface IThreadPoolWorkItem
+    {
+        void Execute();
+    }
+}
\ No newline at end of file