Topic Path: Symbol Reference > Classes > TIdScheduler Class > TIdScheduler Methods > TerminateAllYarns Method
TIdScheduler.TerminateAllYarns Method

Stops execution of all threads or fibers allocated for the scheduler.

procedure TerminateAllYarns; virtual;

TerminateAllYarns is the method used to stop execution of all TIdYarn instances allocated in the ActiveYarns property for the scheduler. 

TerminateAllYarns accesses each TIdYarn instance in the ActiveYarns property, and calls the TerminateYarn method using the current instance as an argument. 

Only one thread or fiber can access the TerminateAllYarns method at a time. Resource protection for the ActiveYarns property is enabled by calling the TIdThreadSafeList.LockList method for the property. If a thread or fiber is blocked due to resource protection, it will wait for the resource to become available by attempting to access the resource every 500ms (.5 seconds). 

After terminating all of the TIdYarn instances in ActiveYarns, resource protection is disabled by calling the TIdThreadSafeList.UnlockList method for the property. 

Descendant classes (like TIdSchedulerOfThreadPool) may implement additional processing in their TerminateAllYarns implementation to provide the additional capabilities required for the scheduler type.

Terminate timeout is not implemented at this time.








Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.