title: runs false if statement when creating new threads
body: <p>I'm writing a program that will email Cat Facts to anybody on a mailing list (not spamming, this is more of a learning experience than anything else). I have 2 arrays, 1 for facts (no problems) and one for emails. The one for emails will always throw an exception (even when in a try/catch block) and all of my if statements are completely ignored when this runs.</p>
  
  <pre><code>public void Broadcast() {
      fact++;
      if (fact ==factCount) {
          fact = 0;
      }
      String[] mailArray = mailingList.ToArray();
      String[] factArray = factList.ToArray();
      int i = mailArray.Length-1;
      String sendFact = factArray[fact];
      while (i&gt;=0) {
          String s = mailArray[i];
          var t = new Thread(() =&gt; Mail(mailArray[i], sendFact));
          t.IsBackground = true;
          t.Start();
          i--;
          if (i==-1) {
              break;
          }
      }
  </code></pre>
  
  <p>The problem is here:</p>
  
  <pre><code>var t = new Thread(() =&gt; Mail(mailArray[i], sendFact));
  </code></pre>
  
  <p>Even when 'i' is -1, the while statement still runs and the break gets ignored. Originally I ran 'i' in reverse, starting at 0 then counting to mailArray.Length-1. It still gave the same issue, ignoring the while and break when I had them set to run in reverse.</p>
  
  <p>Is this a problem with creating new threads?</p>
  
  <p>Edit:</p>
  
  <p>I moved:</p>
  
  <pre><code>    var t = new Thread(() =&gt; Mail(mailArray[i], sendFact));
      t.IsBackground = true;
      t.Start();
  </code></pre>
  
  <p>To a new method and called that instead of the code above - that works perfectly fine.</p>