Changeset 89 for branches/DirectWeb/UPool.pas
- Timestamp:
- Dec 18, 2009, 1:42:22 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DirectWeb/UPool.pas
r88 r89 33 33 function Acquire: TObject; 34 34 procedure Release(Item: TObject); 35 procedure Allocate;36 35 constructor Create; 37 36 destructor Destroy; override; … … 117 116 end; 118 117 119 procedure TThreadedPool.Allocate;120 var121 I: Integer;122 begin123 Clear;124 for I := 0 to TotalCount - 1 do125 Add(TThreadedPoolItem.Create);126 end;127 128 118 constructor TThreadedPool.Create; 129 119 begin 120 inherited; 130 121 Lock := TCriticalSection.Create; 131 ReleaseEvent := TEvent.Create(nil, False, False, ' ThreadPool');122 ReleaseEvent := TEvent.Create(nil, False, False, ''); 132 123 end; 133 124 … … 143 134 constructor TThreadedPoolItem.Create; 144 135 begin 145 if Assigned(Item) then Item.Destroy;136 Item := nil; 146 137 end; 147 138
Note:
See TracChangeset
for help on using the changeset viewer.