RAD Studio VCL Reference
TThreadList Class

TThreadList represents a thread-safe list.

TThreadList = class;
class TThreadList;

A TThreadList object is a thread-safe list. Each TThreadList maintains a private TList (a list of pointers to objects). You can add or remove items in a TThreadList from multiple threads without explicit locks. 

To access the actual TList object managed by the thread list, first lock the list by calling the LockList method. Unlock the list by calling the UnlockList method when done.

Tip: By default, TThreadList ignores attempts to add duplicate entries to the list. If the list is large, this default is computationally expensive. For better performance, you may want to change the Duplicates property to dupAccept where possible.


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!