[Lazarus] Can I be sure that timer and synchronize never fire at once?

Michael Schnell mschnell at lumino.de
Wed Jan 26 12:58:58 CET 2011


On 01/26/2011 11:22 AM, Luca Olivetti wrote:
>
> My application (as almost any application I write) is based on the 
> assumption that methods invoked by a timer and methods invoked by a 
> thread with synchronize will never fire at once (i.e. they will be 
> serialized by the main loop).
>
> Can I be 100% sure of that?
Yep.

If the LCL would not do this this would be a bug. Timer events, 
synchronized events, "procedure ... message" Events fired by 
"PostMessage()" in a thread and Events fired by 
Application.QueueAsyncCall are to be serialized and handled in the main 
thread and thus don't preempt the usual handlers that are fired by 
normal GUI events.

I did encounter other bugs with synchronize etc, but not a bug that 
results in handling an event in another thread.

-Michael




More information about the Lazarus mailing list