Final question for today :) thanks for your input on the previous ones. BTW: Already searched the forum on this and nothing quite answers this one.
We use some 3rd party libraries which pop work onto the Threadpool and we don't want to shutdown while there are outstanding activities.
When shutting down an application, the application will shutdown even if there is work outstanding in the System.Threading.ThreadPool because these threads are back ground threads.
Other than doing some form of reference counting (and enforcing every item Queued into the pool to use this mechanism, which we don't have control over) is there some way to stop the application shutting down while there is outstanding work to be done.
I've looked at using the GetAvailableThreads() vs GetMaxThreads(), but these can be the same because we may have caught the Threadpool as a thread was freed up but not allocated a queued workitem.
All help appreciated?
Kind Regards Noel