[Lazarus] Strange dependency of units

Michael Van Canneyt michael.vancanneyt at wisa.be
Thu Apr 5 15:25:04 CEST 2012



On Thu, 5 Apr 2012, Michael Schnell wrote:

> On 04/05/2012 02:37 PM, michael.vancanneyt at wisa.be wrote:
>> 
>> 
>> TThread.Synchronize works perfectly in any kind of application outside of
>> the LCL.
>> 
>> The main thread just has to call CheckSynchronize at regular intervals.
>> (which is what the LCL does for you).
>> 
> Of course I do know this.
>
> But "regular intervals" (aka polling) is not a good idea.


The LCL does just that: polling.

If no events arrive, checksynchronize is not called.

There is the WakeMainThread function to try and force an event, 
but this can be called outside the LCL as well, thus achieving 
the same effect.

There really is no difference between the LCL or a non-LCL application in
this regard.

Michael.




More information about the Lazarus mailing list