* 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); LThread := TThread(parameter);
WRITE_DEBUG('thread initing, parameter = ', LongInt(LThread)); WRITE_DEBUG('thread initing, parameter = ', LongInt(LThread));
try try
if LThread.FInitialSuspended then begin if LThread.FInitialSuspended then
SemaphoreWait(LThread.FSem); begin
if not LThread.FSuspended then begin SemaphoreWait(LThread.FSem);
LThread.FInitialSuspended := false; if not(LThread.FTerminated) then
WRITE_DEBUG('going into LThread.Execute'); begin
LThread.Execute; if not LThread.FSuspended then
end; begin
end else begin LThread.FInitialSuspended := false;
WRITE_DEBUG('going into LThread.Execute'); WRITE_DEBUG('going into LThread.Execute');
LThread.Execute; LThread.Execute;
end; end;
end;
end
else
begin
WRITE_DEBUG('going into LThread.Execute');
LThread.Execute;
end;
except except
on e: exception do begin on e: exception do begin
WRITE_DEBUG('got exception: ',e.message); WRITE_DEBUG('got exception: ',e.message);