From: "Graeme Geldenhuys" <[EMAIL PROTECTED]>
On 06/12/2007, Yury Sidorov <[EMAIL PROTECTED]> wrote:
The thread itself works, but not Synchronize() method.
You need to call CheckSynchronize inside main loop.
Ah, thanks Yury! That also means that having the main loop fire
every
500ms (it was just a test for the console app), my timer cannot fire
it's events in less than 500ms (eg: timer.Interval := 200).
while True do
begin
if FileExists('killme') then
break;
Sleep(500);
CheckSynchronize;
writeln('event loop');
end;
As a test, I set the main loop's Sleep() to 10ms and the app didn't
even register in 'top' for CPU usage, so I guess it's ok to set
sleep() with such a small time?
Not that I intend to use the Timer interval for <500ms though.
AFAIK you can remove Sleep(500); and replace it by
CheckSynchronize(500);
Yury.
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel