title: Process is terminated due to StackOverflowException
body: <p>This is difficult situation to explain. Have a service process that starts 2 threads, each thread loops forever but sleeps for 5 minutes each once the payload is finished. </p>
  
  <p>Problem is that my second thread terminates well before the payload is even finished, for no apparent reason, and i also can't catch the exception as it seems to be triggered from outside the delegate process?</p>
  
  <p>Any suggestions on how to find the problem?</p>
  
  <p>The code....</p>
  
  <pre><code>public void StartService()
  {
    ThreadStart stRecieve = new ThreadStart(DownloadNewMail);
    ThreadStart stSend = new ThreadStart(SendNewMail);
    senderThread = new Thread(stRecieve);
    recieverThread = new Thread(stSend);
  
    sendStarted = true;
    recieveStarted = true;
  
    senderThread.Start();
    recieverThread.Start();
  }
  
  private void DownloadNewMail()
  {
    while(recieveStarted)
    {
      //Payload....
  
      if (recieveStarted)
      {
        Thread.Sleep(new TimeSpan(0, confSettings.PollInterval, 0));
      }
    }
  }
  
  private void SendNewMail()
  {
    while(sendStarted)
    {
      //Payload....
  
      if (sendStarted)
      {
        Thread.Sleep(new TimeSpan(0, confSettings.PollInterval, 0));
      }
    }
  </code></pre>
  
  <p>}</p>