It is my understanding that anything running using .NETs threadpool like this:
ThreadPool.QueueUserWorkItem(myproc);
will get terminated cleanly by the CLR when the application is closed down.
Let's say in this case that the myproc function contains an infinite loop. Is there a way I can hook into the termination of the thread?