Changeset 89 for trunk/Packages/Common/UResetableThread.pas
- Timestamp:
- Sep 6, 2012, 8:29:27 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UResetableThread.pas
r84 r89 54 54 procedure MethodFinish(Sender: TObject); 55 55 protected 56 procedure ThreadException(Sender: TObject; E: Exception);57 56 function NewItemObject: TObject; override; 58 57 public 59 58 LastExceptionClass: TClass; 60 59 LastExceptionMessage: string; 60 procedure ThreadException(Sender: TObject; E: Exception); 61 61 procedure CheckException; 62 62 procedure WaitForEmpty; … … 273 273 procedure TThreadPool.RunInThread(AMethod: TMethodCall); 274 274 begin 275 CheckException; 276 with TResetableThread(Acquire) do begin 277 Method := AMethod; 278 OnFinished := MethodFinish; 279 Start; 275 try 276 with TResetableThread(Acquire) do begin 277 Method := AMethod; 278 OnFinished := MethodFinish; 279 Start; 280 end; 281 finally 282 CheckException; 280 283 end; 281 284 end;
Note:
See TracChangeset
for help on using the changeset viewer.