[Lazarus] "Active NoGui" LCL Widget Type

Michael Schnell mschnell at lumino.de
Thu Jul 10 13:33:34 CEST 2014


In order not to steel yet another Thread topic I answer in a new thread....

On 06/27/2014 11:35 AM, Mattias Gaertner wrote in "Re: [Lazarus] nonlcl 
basic issue: is codetools LCL dependent?":
>
>>   handling the waiting and waking for both Queues simultaneously. This (waiting and waking regarding the additional queue) needs arch depending code (as done in the GUI based Widget Types).
>
> That's not arch dependent, but library dependent.
> In case of nogui there is no library, so you have the full control.

I just re-checked and found that in thread.inc the "waiting and waking" 
is done by calls to callback variables such as "rtleventWaitFor" and 
"rtleventSetEvent".

When initializing, these variables are filled with the appropriate 
"OS-depending" function pointers by code in the file  "systhrd.inc" 
located in the OS-appropriate folder.

I understand that the "rtlevent..." stuff and the method to append an 
event to the TThread queue  is private to TThread and hence I can't use 
this for TTimer and TApplication.QueueAsyncCall, Hence my only option 
(other than constructing an additional queue including an additional 
"OS-depending" "waiting and waking" mechanism) is using the timeout of 
CheckSynchronize (e.g. for TTimer), and TThread.Queue (e.g. for 
TApplication.QueueAsyncCall).

And this is what "technically" already seems to work rather nicely.

With that it will only work "officially" with the next release of the 
fpc rtl (no problem for me, but maybe preventing a "decent" patch to the 
"official" svn).

What can't be done without a modification in the fpc RTL is that this 
way TApplication.QueueAsyncCall will not be Queued  when called from the 
main thread (no problem for me, but maybe preventing a "decent" patch to 
the "official" svn).

-Michael




More information about the Lazarus mailing list