Changeset 305 for Common/UThreading.pas
- Timestamp:
- Jan 3, 2012, 10:31:59 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/UThreading.pas
r295 r305 17 17 TVirtualThread = class 18 18 private 19 function GetFinished: Boolean; virtual; abstract; 19 20 function GetFreeOnTerminate: Boolean; virtual; abstract; 20 21 function GetPriority: TThreadPriority; virtual; abstract; … … 42 43 property Priority: TThreadPriority read GetPriority write SetPriority; 43 44 property Terminated: Boolean read GetTerminated write SetTerminated; 45 property Finished: Boolean read GetFinished; 44 46 property ThreadId: Integer read GetThreadId; 45 47 end; … … 61 63 private 62 64 FTerminated: Boolean; 65 FFinished: Boolean; 63 66 FThread: TListedThreadExecute; 67 function GetFinished: Boolean; override; 64 68 function GetFreeOnTerminate: Boolean; override; 65 69 function GetPriority: TThreadPriority; override; … … 172 176 end; 173 177 174 175 178 { TThreadList } 176 179 … … 196 199 begin 197 200 try 198 Parent.Execute; 199 except 200 on E: Exception do 201 if Assigned(OnException) then 202 OnException(Parent.FThread, E); 201 try 202 Parent.Execute; 203 except 204 on E: Exception do 205 if Assigned(OnException) then 206 OnException(Parent.FThread, E); 207 end; 208 finally 209 Parent.FFinished := True; 203 210 end; 204 211 end; 205 212 206 213 { TListedThread } 214 215 function TListedThread.GetFinished: Boolean; 216 begin 217 Result := FFinished; 218 end; 207 219 208 220 function TListedThread.GetFreeOnTerminate: Boolean; … … 255 267 const StackSize: SizeUInt); 256 268 begin 269 FFinished := False; 270 FTerminated := False; 271 257 272 FThread := TListedThreadExecute.Create(True, StackSize); 258 273 FThread.Parent := Self;
Note:
See TracChangeset
for help on using the changeset viewer.