Changeset 145 for trunk/Packages/Common/Pool.pas
- Timestamp:
- Jun 5, 2023, 6:44:57 PM (18 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Pool.pas
r144 r145 1 unit UPool;1 unit Pool; 2 2 3 3 interface 4 4 5 5 uses 6 Classes, SysUtils, syncobjs, fgl, UThreading;6 Classes, SysUtils, syncobjs, Generics.Collections, Threading; 7 7 8 8 type … … 20 20 function NewItemObject: TObject; virtual; 21 21 public 22 Items: T FPGObjectList<TObject>;23 FreeItems: T FPGObjectList<TObject>;22 Items: TObjectList<TObject>; 23 FreeItems: TObjectList<TObject>; 24 24 function Acquire: TObject; virtual; 25 25 procedure Release(Item: TObject); virtual; … … 106 106 constructor TThreadedPool.Create; 107 107 begin 108 inherited Create;108 inherited; 109 109 Lock := TCriticalSection.Create; 110 110 end; … … 114 114 TotalCount := 0; 115 115 Lock.Free; 116 inherited Destroy;116 inherited; 117 117 end; 118 118 … … 183 183 begin 184 184 inherited; 185 Items := T FPGObjectList<TObject>.Create;186 FreeItems := T FPGObjectList<TObject>.Create;187 FreeItems. FreeObjects := False;185 Items := TObjectList<TObject>.Create; 186 FreeItems := TObjectList<TObject>.Create; 187 FreeItems.OwnsObjects := False; 188 188 FReleaseEvent := TEvent.Create(nil, False, False, ''); 189 189 end; … … 199 199 200 200 end. 201
Note:
See TracChangeset
for help on using the changeset viewer.