From Appmethod Libraries
Jump to: navigation, search


Object Pascal

TThreadList = class


class PASCALIMPLEMENTATION TThreadList : public System::TObject


Type Visibility Source Unit Parent
class public
System.Classes System.Classes


TThreadList represents a thread-safe list.

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.

See Also