FreeOnTerminate removed, freeing threads manually now
This commit is contained in:
parent
80fbb671e3
commit
4c738a47ed
@ -31,11 +31,13 @@ type
|
||||
|
||||
implementation
|
||||
|
||||
//uses SysUtils, FormRender;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
constructor TBucketFillerThread.Create(cp: TControlPoint);
|
||||
begin
|
||||
inherited Create(True);
|
||||
Self.FreeOnTerminate := True;
|
||||
//Self.FreeOnTerminate := True;
|
||||
|
||||
Fcp := cp.Clone;
|
||||
|
||||
@ -58,6 +60,7 @@ var
|
||||
bc: integer;
|
||||
begin
|
||||
inherited;
|
||||
//RenderForm.Output.Lines.Add(' . . . > Filler thread #' + IntToStr(ThreadID) + ' Started');
|
||||
|
||||
bc := 0;
|
||||
while (not Terminated) and (bc < Nrbatches) do begin
|
||||
@ -74,6 +77,7 @@ begin
|
||||
LeaveCriticalSection(CriticalSection);
|
||||
end;
|
||||
end;
|
||||
//RenderForm.Output.Lines.Add(' . . . > Filler thread #' + IntToStr(ThreadID) + ' Finished');
|
||||
end;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -104,6 +104,8 @@ begin
|
||||
|
||||
for i := 0 to High(WorkingThreads) do begin
|
||||
WorkingThreads[i].Terminate;
|
||||
WorkingThreads[i].WaitFor;
|
||||
WorkingThreads[i].Free;
|
||||
end;
|
||||
SetLength(WorkingThreads, 0);
|
||||
|
||||
@ -128,7 +130,7 @@ var
|
||||
begin
|
||||
for i := 0 to High(WorkingThreads) do
|
||||
WorkingThreads[i].Terminate;
|
||||
SetLength(WorkingThreads, 0); //?
|
||||
//SetLength(WorkingThreads, 0); //?
|
||||
|
||||
inherited; // FStop := 1;
|
||||
end;
|
||||
@ -143,7 +145,7 @@ begin
|
||||
|
||||
for i := 0 to High(WorkingThreads) do
|
||||
WorkingThreads[i].Terminate;
|
||||
SetLength(WorkingThreads, 0); //?
|
||||
//SetLength(WorkingThreads, 0); //?
|
||||
end;
|
||||
|
||||
procedure TBaseMTRenderer.Pause;
|
||||
@ -167,8 +169,8 @@ begin
|
||||
end;
|
||||
|
||||
procedure TBaseMTRenderer.SetThreadPriority(p: TThreadPriority);
|
||||
var
|
||||
i: integer;
|
||||
//var
|
||||
// i: integer;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
@ -181,7 +183,7 @@ function TBaseMTRenderer.NewThread: TBucketFillerThread;
|
||||
begin
|
||||
Result := TBucketFillerThread.Create(fcp);
|
||||
assert(Result<>nil);
|
||||
//Result.Priority := FThreadPriority;
|
||||
Result.Priority := tpLower; //FThreadPriority;
|
||||
|
||||
if FCP.FAngle = 0 then
|
||||
Result.AddPointsProc := self.AddPointsToBuckets
|
||||
|
Loading…
Reference in New Issue
Block a user