Skip to content

TThreadList

Thread-safe list object.

Declaration

Source position: classesh.inc line 643

type

  TThreadList = class
  public
    constructor Create;
    destructor Destroy;
    procedure Add;
    procedure Clear;
    function LockList : TList;
    procedure Remove;
    procedure UnlockList;
    property Duplicates: TDuplicates; {rw}
  end;

Description

TThreadList is a thread-safe Tlist implementation. Unlike TList, it can be accessed read-write by multiple threads: the list implementation will take care of locking the list when adding or removing items from the list.

Properties

Member Visibility Description
Duplicates public Describes what to do with duplicates.

Methods

Member Visibility Description
Add public Adds an element to the list.
Clear public Removes all elements from the list.
Create public Creates a new thread-safe list.
Destroy public Destroys the list instance.
LockList public Locks the list for exclusive access.
Remove public Removes an item from the list.
UnlockList public Unlocks the list after it was locked.

See also

Name Description
TList Class to manage collections of pointers.