title: ASP.NET Threading Issue
body: <p>Problem:  I am working on a ASP.NET 2.0/C# Application and I need to do the following:</p>
  
  <p>I have a function I am using from a third-party library lets say</p>
  
  <pre><code>MyFunctions.CalculateTotal(int a, int b);
  </code></pre>
  
  <p>A known issue is that the thread locks resources.  So there is another function that needs to be called afterwards to clean everything up.</p>
  
  <pre><code>MyFunctions.ThreadExit();
  </code></pre>
  
  <p>The issue is that this will exit the current thread and I will not be able to use any other function afterwards. Also, it does not seem appropriate for me to kill an asp.net thread like this.</p>
  
  <p>I have considered spinning a separate thread, but that would be a hack.</p>
  
  <p>Global.asax has those application wide events like Application_Start/End </p>
  
  <p>I know there is no event such as  Application_ThreadStart/End, but maybe something like that? </p>
  
  <p>Any other suggestion for a possible solution?</p>