Internet Direct (Indy) Version 9.0.1 Beta
TIdThreadMgr
Specifies the base class for the Indy thread management framework.

TIdThreadMgr = class(TIdBaseComponent)
Description
TIdThreadMgr is the ancestor class for the thread manager classes in Indy, such as TIdThreadMgrDefault and TIdThreadMgrPool, and provides a thread management framework.

TIdThreadMgr defines properties and methods needed to allocate and release threads, monitor active threads, terminate a list of running threads, safeguard thread operations, and determine the thread class used by the thread manager to create new thread instances.

Instances of a TIdThreadMgr descendant can be assigned to the TIdTCPServer.ThreadMgr property to provide the functionality specific to the thread manager.

Descendants of TIdThreadMgr must implement the virtual abstract methods GetThread and ReleaseThread, and use some mechanism to protect resources while maintaining the list of active threads during these operations.

Use TerminateThreads to notify the ActiveThreads list that all TIdThread instances should close their socket connections, release the thread with RelaseThread, and remove the thread from ActiveThreads.

Assign an instance of TIdThreadClass to ThreadClass before using the thread manager to allocate new threads.