private static Thread InitializeExistingThreadPoolThread() { ThreadPool.InitializeForThreadPoolThread(); InitializeComForThreadPoolThread(); Thread thread = CurrentThread; thread.SetThreadStateBit(ThreadPoolThread); return(thread); }
private static void InitializeExistingThreadPoolThread() { // Take advantage of implicit MTA initialized by the finalizer thread SpinWait sw = new SpinWait(); while (!s_comInitializedOnFinalizerThread) { RuntimeImports.RhInitializeFinalizerThread(); sw.SpinOnce(0); } // Prevent re-initialization of COM model on threadpool threads t_comState |= ComState.Locked; ThreadPool.InitializeForThreadPoolThread(); }
private static void InitializeExistingThreadPoolThread() { ThreadPool.InitializeForThreadPoolThread(); }