365 [
Obsolete(
"ThreadPool.BindHandle(IntPtr) has been deprecated. Use ThreadPool.BindHandle(SafeHandle) instead.")]
471 long num = (long)
timeout.TotalMilliseconds;
476 if (num >
int.MaxValue)
486 long num = (long)
timeout.TotalMilliseconds;
491 if (num >
int.MaxValue)
602 if (workStealingQueue ==
null || workStealingQueue.m_array ==
null)
606 object[] items = workStealingQueue.m_array;
607 foreach (
object obj in items)
620 if (workStealingQueue ==
null || workStealingQueue.
m_array ==
null)
624 object[] items = workStealingQueue.
m_array;
625 foreach (
object obj in items)
656 object[]
array =
new object[num];
660 if (num <
array.Length)
static bool GetBooleanConfig(string configName, bool defaultValue)
static void SetSwitch(string switchName, bool isEnabled)
static void SetData(string name, object? data)
static string ArgumentOutOfRange_LessEqualToIntegerMaxVal
static string ArgumentOutOfRange_NeedNonNegOrNegative1
static ? ExecutionContext Capture()
static void EnsureGateThreadRunning()
static readonly PortableThreadPool ThreadPoolInstance
static ThreadPoolWorkQueueThreadLocals threadLocals
static WorkStealingQueue[] Queues
volatile object[] m_array
static bool LocalFindAndPop(object callback)
static bool NotifyThreadBlocked()
static bool SetMinThreadsNative(int workerThreads, int completionPortThreads)
static void GetMaxThreadsNative(out int workerThreads, out int completionPortThreads)
static RegisteredWaitHandle RegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callBack, object state, uint millisecondsTimeOutInterval, bool executeOnlyOnce, bool flowExecutionContext)
static bool BindIOCompletionCallbackNative(IntPtr fileHandle)
static bool SupportsTimeSensitiveWorkItems
static void GetAvailableThreadsNative(out int workerThreads, out int completionPortThreads)
static readonly bool UsePortableThreadPool
static Interop.BOOL PerformRuntimeSpecificGateActivitiesNative(int cpuUtilization)
static unsafe int GetNextConfigUInt32Value(int configVariableIndex, out uint configValue, out bool isBoolean, out char *appContextConfigName)
static bool QueueUserWorkItem< TState >(Action< TState > callBack, TState state, bool preferLocal)
static void EnsureGateThreadRunning()
static void SetMinIOCompletionThreads(int ioCompletionThreads)
static readonly ThreadPoolWorkQueue s_workQueue
static RegisteredWaitHandle RegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callBack, object? state, uint millisecondsTimeOutInterval, bool executeOnlyOnce)
static void NotifyWorkItemProgress()
static object[] ToObjectArray(IEnumerable< object > workitems)
static object[] GetQueuedWorkItemsForDebugger()
static bool EnableWorkerTracking
static bool PerformRuntimeSpecificGateActivities(int cpuUtilization)
static object[] GetGloballyQueuedWorkItemsForDebugger()
static long GetPendingUnmanagedWorkItemCount()
static void GetMinThreadsNative(out int workerThreads, out int completionPortThreads)
static bool QueueUserWorkItem(WaitCallback callBack)
static void UnsafeQueueUnmanagedWorkItem(IntPtr callback, IntPtr state)
static bool BindHandle(IntPtr osHandle)
static void SetMaxIOCompletionThreads(int ioCompletionThreads)
static object[] GetLocallyQueuedWorkItemsForDebugger()
static long GetCompletedWorkItemCount()
static IEnumerable< object > GetQueuedWorkItems()
static bool SetMinThreads(int workerThreads, int completionPortThreads)
static void ReportThreadStatus(bool isWorking)
static bool GetEnableWorkerTracking()
static long PendingWorkItemCount
static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callBack, object? state, uint millisecondsTimeOutInterval, bool executeOnlyOnce)
static RegisteredWaitHandle RegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callBack, object? state, long millisecondsTimeOutInterval, bool executeOnlyOnce)
static RegisteredWaitHandle RegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callBack, object? state, TimeSpan timeout, bool executeOnlyOnce)
static bool UnsafeQueueUserWorkItem< TState >(Action< TState > callBack, TState state, bool preferLocal)
static IEnumerable< object > GetGloballyQueuedWorkItems()
static bool UnsafeQueueUserWorkItem(WaitCallback callBack, object? state)
static void NotifyThreadUnblocked()
static bool GetEnableWorkerTrackingNative()
static void ReportThreadStatusNative(bool isWorking)
static void UnsafeQueueWaitCompletion(CompleteWaitThreadPoolWorkItem completeWaitWorkItem)
static void UnsafeQueueTimeSensitiveWorkItemInternal(IThreadPoolWorkItem timeSensitiveWorkItem)
static int GetThreadCount()
static bool TryPopCustomWorkItem(object workItem)
static void QueueWaitCompletionNative(CompleteWaitThreadPoolWorkItem completeWaitWorkItem)
static void NotifyWorkItemProgressNative()
static long PendingUnmanagedWorkItemCount
static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callBack, object? state, TimeSpan timeout, bool executeOnlyOnce)
static void GetAvailableThreads(out int workerThreads, out int completionPortThreads)
static unsafe bool InitializeConfigAndDetermineUsePortableThreadPool()
static void UnsafeQueueUserWorkItemInternal(object callBack, bool preferLocal)
static bool NotifyWorkItemComplete(object threadLocalCompletionCountObject, int currentTimeMs)
static Interop.BOOL RequestWorkerThreadNative()
static bool UnsafeQueueUserWorkItem(IThreadPoolWorkItem callBack, bool preferLocal)
static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callBack, object? state, int millisecondsTimeOutInterval, bool executeOnlyOnce)
static bool CanSetMinIOCompletionThreads(int ioCompletionThreads)
static bool CanSetMaxIOCompletionThreads(int ioCompletionThreads)
static unsafe bool UnsafeQueueNativeOverlapped(NativeOverlapped *overlapped)
static readonly Action< object > s_invokeAsyncStateMachineBox
static bool SetMaxThreadsNative(int workerThreads, int completionPortThreads)
static bool BindHandle(SafeHandle osHandle)
static bool QueueUserWorkItem(WaitCallback callBack, object? state)
static IntPtr RegisterWaitForSingleObjectNative(WaitHandle waitHandle, object state, uint timeOutInterval, bool executeOnlyOnce, RegisteredWaitHandle registeredWaitHandle)
static bool NotifyWorkItemCompleteNative()
static void GetMaxThreads(out int workerThreads, out int completionPortThreads)
static void GetMinThreads(out int workerThreads, out int completionPortThreads)
static void RequestWorkerThread()
static unsafe bool PostQueuedCompletionStatus(NativeOverlapped *overlapped)
static readonly bool IsWorkerTrackingEnabledInConfig
static long CompletedWorkItemCount
static RegisteredWaitHandle RegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callBack, object? state, int millisecondsTimeOutInterval, bool executeOnlyOnce)
static object GetOrCreateThreadLocalCompletionCountObject()
static IEnumerable< object > GetLocallyQueuedWorkItems()
static bool SetMaxThreads(int workerThreads, int completionPortThreads)
static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callBack, object? state, long millisecondsTimeOutInterval, bool executeOnlyOnce)
static void ThrowArgumentOutOfRangeException(System.ExceptionArgument argument)
static void ThrowArgumentNullException(string name)
delegate void WaitOrTimerCallback(object? state, bool timedOut)