Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Remove empty Threadpool .cctors
Browse files Browse the repository at this point in the history
  • Loading branch information
benaadams committed Feb 12, 2016
1 parent cb1effa commit b2026f3
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions src/mscorlib/src/System/Threading/ThreadPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ internal static class ThreadPoolGlobals
public static bool enableWorkerTracking;

[SecurityCritical]
public static ThreadPoolWorkQueue workQueue = new ThreadPoolWorkQueue();
public static ThreadPoolWorkQueue workQueue = InitWorkQueue();

[System.Security.SecuritySafeCritical] // static constructors should be safe to call
static ThreadPoolGlobals()
[SecurityCritical]
private static ThreadPoolWorkQueue InitWorkQueue()
{
return new ThreadPoolWorkQueue();
}
}

Expand Down Expand Up @@ -1168,9 +1169,6 @@ internal interface IThreadPoolWorkItem

internal sealed class QueueUserWorkItemCallback : IThreadPoolWorkItem
{
[System.Security.SecuritySafeCritical]
static QueueUserWorkItemCallback() {}

private WaitCallback callback;
private ExecutionContext context;
private Object state;
Expand Down Expand Up @@ -1249,7 +1247,13 @@ void IThreadPoolWorkItem.MarkAborted(ThreadAbortException tae)
}

[System.Security.SecurityCritical]
static internal ContextCallback ccb = new ContextCallback(WaitCallback_Context);
static internal ContextCallback ccb = InitCallbackContext();

[System.Security.SecurityCritical]
static private ContextCallback InitCallbackContext()
{
return new ContextCallback(WaitCallback_Context);
}

[System.Security.SecurityCritical]
static private void WaitCallback_Context(Object state)
Expand All @@ -1263,16 +1267,19 @@ static private void WaitCallback_Context(Object state)

internal class _ThreadPoolWaitOrTimerCallback
{
[System.Security.SecuritySafeCritical]
static _ThreadPoolWaitOrTimerCallback() {}

WaitOrTimerCallback _waitOrTimerCallback;
ExecutionContext _executionContext;
Object _state;
[System.Security.SecurityCritical]
static private ContextCallback _ccbt = new ContextCallback(WaitOrTimerCallback_Context_t);
[System.Security.SecurityCritical]
static private ContextCallback _ccbf = new ContextCallback(WaitOrTimerCallback_Context_f);
static private ContextCallback _ccbf = InitCallbackContext();

[System.Security.SecurityCritical]
static private ContextCallback InitCallbackContext()
{
return new ContextCallback(WaitOrTimerCallback_Context_f);
}

[System.Security.SecurityCritical] // auto-generated
internal _ThreadPoolWaitOrTimerCallback(WaitOrTimerCallback waitOrTimerCallback, Object state, bool compressStack, ref StackCrawlMark stackMark)
Expand Down

0 comments on commit b2026f3

Please sign in to comment.