Internet Direct (Indy) Version 9.0.2 Beta
TIdThreadMgrPool.ReleaseThread
Remove a thread from the active thread list.

procedure ReleaseThread(AThread: TIdThread); override;
Parameters
AThread: TIdThread
Thread to be released.

Description
ReleaseThread implements the inherited abstract procedure that instructs the thread manager to remove AThread from the list of active threads in ActiveThreads.

If the thread has not Terminated, and ThreadPool does not exceed PoolSize, the thread instance will be Stopped and returned to ThreadPool.

If AThread is the current Terminated thread of execution, it is allowed to complete with Terminate. If AThread is not the current thread of execution, AThread.TerminateAndWaitFor is called and the thread is Freed.

ReleaseThread locks and unlocks the ThreadPool list to protect resources while handling the thread instance.