|An interface to allow a class to monitor an instance of a thread pool. The interface assumes that threads in the pool go through the following life-cycle: created, begin processing, end processing, destroyed, and that they may optionally (hopefully not) generate errors. Obviously a thread is likely to begin and end processing several work items before it is destroyed. The methods on this interface can be called either from any thread and may not be called from the thread pool thread itself. Incrementing a counter when OnThreadCreated() is called and decrementing it when OnThreadDestroyed() is called will give you a count of the number of threads that are in existence at any one time. A corresponding counter that is incremented in OnThreadBeginProcessing() and decremented in OnThreadEndProcessing() is called will give a count of the threads that are currently in use. More...