* fixed tw4201 after changes from yesterday (when a FInitialSuspended

thread is only resumed when it's terminated no longer executes
    the Execute method, and properly terminates the thread)

git-svn-id: trunk@3893 -
This commit is contained in:
Jonas Maebe 2006-06-19 07:47:37 +00:00
parent 79703f834e
commit 8e952b634d

View File

@ -146,17 +146,24 @@ begin
LThread := TThread(parameter);
WRITE_DEBUG('thread initing, parameter = ', LongInt(LThread));
try
if LThread.FInitialSuspended then begin
SemaphoreWait(LThread.FSem);
if not LThread.FSuspended then begin
LThread.FInitialSuspended := false;
WRITE_DEBUG('going into LThread.Execute');
LThread.Execute;
end;
end else begin
WRITE_DEBUG('going into LThread.Execute');
LThread.Execute;
end;
if LThread.FInitialSuspended then
begin
SemaphoreWait(LThread.FSem);
if not(LThread.FTerminated) then
begin
if not LThread.FSuspended then
begin
LThread.FInitialSuspended := false;
WRITE_DEBUG('going into LThread.Execute');
LThread.Execute;
end;
end;
end
else
begin
WRITE_DEBUG('going into LThread.Execute');
LThread.Execute;
end;
except
on e: exception do begin
WRITE_DEBUG('got exception: ',e.message);