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?":
Show quoted text 5 lines
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
