Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Toub <stoub@microsoft.com>2017-09-27 06:18:44 +0300
committerStephen Toub <stoub@microsoft.com>2017-09-27 06:18:44 +0300
commit5c202338706f3d33b28fa908ca9a4361b0b47441 (patch)
treec27ccda000524e756b2c38d2f7bb1559615aea35
parent3828955600cbc07cc8a072b1a82c10fb0f9bde0a (diff)
Add ThreadPool.QueueUserWorkItem(..., bool preferLocal)
-rw-r--r--src/System.Private.CoreLib/src/System/Threading/ThreadPool.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/System.Private.CoreLib/src/System/Threading/ThreadPool.cs b/src/System.Private.CoreLib/src/System/Threading/ThreadPool.cs
index e43665391..2c382076c 100644
--- a/src/System.Private.CoreLib/src/System/Threading/ThreadPool.cs
+++ b/src/System.Private.CoreLib/src/System/Threading/ThreadPool.cs
@@ -1014,9 +1014,12 @@ namespace System.Threading
}
public static bool QueueUserWorkItem(WaitCallback callBack) =>
- QueueUserWorkItem(callBack, null);
+ QueueUserWorkItem(callBack, null, preferLocal: false);
- public static bool QueueUserWorkItem(WaitCallback callBack, object state)
+ public static bool QueueUserWorkItem(WaitCallback callBack, object state) =>
+ QueueUserWorkItem(callBack, state, preferLocal: false);
+
+ public static bool QueueUserWorkItem(WaitCallback callBack, object state, bool preferLocal)
{
if (callBack == null)
{
@@ -1029,7 +1032,7 @@ namespace System.Threading
new QueueUserWorkItemCallbackDefaultContext(callBack, state) :
(IThreadPoolWorkItem)new QueueUserWorkItemCallback(callBack, state, context);
- ThreadPoolGlobals.workQueue.Enqueue(tpcallBack, forceGlobal: true);
+ ThreadPoolGlobals.workQueue.Enqueue(tpcallBack, forceGlobal: !preferLocal);
return true;
}