mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-23 02:29:19 +02:00
Better for for checkcontrolmessage, based on Mattias Gaertner tip
git-svn-id: trunk@9268 -
This commit is contained in:
parent
efdddfd82c
commit
a8eb62ff54
@ -1137,10 +1137,7 @@ begin
|
|||||||
if not FDaemon.Execute then
|
if not FDaemon.Execute then
|
||||||
begin
|
begin
|
||||||
While Not Terminated do
|
While Not Terminated do
|
||||||
begin
|
|
||||||
CheckControlMessage(True);
|
CheckControlMessage(True);
|
||||||
Sleep(50);
|
|
||||||
end;
|
|
||||||
CheckControlMessage(False);
|
CheckControlMessage(False);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -112,6 +112,8 @@ end;
|
|||||||
|
|
||||||
procedure TDaemonThread.CheckControlMessage(WaitForMessage : Boolean);
|
procedure TDaemonThread.CheckControlMessage(WaitForMessage : Boolean);
|
||||||
begin
|
begin
|
||||||
|
If WaitForMessage then // Don't hog CPU.
|
||||||
|
Sleep(50);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user