Can foreground threads be aborted on application shutdown in C#.Net?
<p>I inherited a c# winforms app (.NET 2.0) which creates a thread upon startup in a singleton class. This thread handles messages from a messaging topic (Tibco EMS).</p>

<p>When the app is shutdown, the thread doesn't remain the the background? How is this possible? Is there something else happening that can abort this thread?</p>

<p>Code snippet: </p>

<pre><code>public class Startup {
    public static void main(string [] args) {
        MySingletonClass.Instance.Init();
       // do other things below
       Application.Run(new MainForm());
    }

public class MySingletonClass {
// singleton code
//..
//..

private Thread t;  
public void Init() {
    t = new Thread(new ThreadStart(poll));
    t.Start();
}

private void poll() {
    while(true} {
        // listen for messages and process but there is no break clause
        // exceptions are also handled within to ensure control doesnt go out
    }
}
</code></pre>

<p>Pls. don't write to tell me this is bad code. I know it and i was going to refactor it when i realised that the app actually shutdowns correctly inspite of this aberration. 
So i want to understand how this is possible.</p>

<p>Thanks for your help</p>
