title: Why C# thread stop working automatically
body: <p>I have a thread in my program which runs the timer function for example</p>
  
  <pre><code>Thread PopMonitoringThread = new Thread(new ThreadStart(PopMonitoring));  
  PopMonitoringThread.Start();
  
  public static void PopMonitoring()
  {
      TimerCallback callback = new TimerCallback(Tick);
      Timer stateTimer = new Timer(callback, null, 0, 1000);
  }
  
  //Timer method
  static public void Tick(Object stateInfo)
  {
      try
      {
          if (Properties.Settings.Default.BatchingMode &gt; 0)
          {
              if (batchTime.Subtract(DateTime.Now) &lt; TimeSpan.Zero)
              {
                  batchTime = DateTime.Now.AddMinutes(Properties.Settings.Default.BatchingMode);
                  Console.WriteLine("-----------------------------------------------------");
                  Process();
                  Console.WriteLine("Batch Process Run");
                  Console.WriteLine("-----------------------------------------------------");
              }
              Console.WriteLine("{0}", DateTime.Now.ToString("h:mm:ss"));
          }
          Console.WriteLine("Pop3 Monitoring start after: {0}", batchTime.Subtract(DateTime.Now));
      }
      catch (Exception e)
      {
          throw e;
      }
  }
  </code></pre>
  
  <p>When I comment out my Process() method it works fine every second my timer interation works
  but when I uncomment Process method from my Tick method timer stops working ie Tick method stops working.
  Process method code is working perfect mean there are no compile and runtime errors.</p>