/// <summary> /// <para>Internal mechanism used when timers are added to wake up / create the thread.</para> /// </summary> private static void Prod() { s_ThreadReadyEvent.Set(); TimerThreadState oldState = (TimerThreadState)Interlocked.CompareExchange( ref s_ThreadState, (int)TimerThreadState.Running, (int)TimerThreadState.Idle); if (oldState == TimerThreadState.Idle) { new Thread(new ThreadStart(ThreadProc)).Start(); } }
/// <summary> /// <para>Internal mechanism used when timers are added to wake up / create the thread.</para> /// </summary> private static void Prod() { s_threadReadyEvent.Set(); TimerThreadState oldState = (TimerThreadState)Interlocked.CompareExchange( ref s_threadState, (int)TimerThreadState.Running, (int)TimerThreadState.Idle); if (oldState == TimerThreadState.Idle) { new Thread(new ThreadStart(ThreadProc)) { IsBackground = true, Name = ".NET Network Timer" }.Start(); } }