mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 23:09:18 +02:00
* 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:
parent
79703f834e
commit
8e952b634d
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user