[Lazarus] nonlcl basic issue: is codetools LCL dependent?

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Jun 26 19:38:59 CEST 2014


On Thu, 26 Jun 2014 16:52:59 +0200
Michael Schnell <mschnell at lumino.de> wrote:

> On 06/26/2014 03:54 PM, Mattias Gaertner wrote:
> > Application.ProcessMessages calls CheckSynchronize and calls the
> > queued async calls. Under nogui that's all.
> Here the waiting and sleeping mechanism is lacking.

If you mean for TTimer: Yes, I'm waiting for your patch.

 
> Application.ProcessMessages supposedly calls CheckSynchronize with the 
> Timeout set to 0.

Yes.

> The timeout is critical for me, as it is used to implement TTimer.
> 
> In my Application CheckSynchronize always is called with the Timeout set 
> to a non zero  Value.
> 
> TThread.Queue in the end calls WakeMainThread() to wake the main thread 
> (i.e. terminate the CheckSynchronize call waiting for a timeout).
> 
> I did not yet find any lower level non private queue-feed functionality 
> usable  instead of TThread.Queue.

So? Program a queue.

 
> > Other widgetsets process
> > the widgetsets events as well.
> They implement a second queue besides the one the RTL implements for 
> TThread.

Probably they have several.

 
> > A LCL program calls Application.Run, which is a loop calling
> > Application.ProcessMessages. You can create sub loops. A common example
> > is TForm.ShowModal, which also calls Application.ProcessMessages.
> > Or you can do your own loop, in which case you have to call it yourself.
> >
> > If you call CheckSynchronize instead of Application.ProcessMessages you
> > simply omit the widgetsets and queued async calls.
> Other "active" LCL Widget Types call CheckSynchronize with Timeout set 
> to Zero and implement their own arch depending waiting mechanism, as 
> they are greatly arch depending anyway. My tiny Application not 
> inherently arch depending implementation just uses CheckSynchronize to 
> do the waiting (e.g. for TTimer) and hence does not an arch depending 
> implementation for this.

Ok. You have the tools, you have a proof of concept, now program it
and create a patch.

Mattias




More information about the Lazarus mailing list