[Lazarus] TThread in console mode program.

Donald Ziesig donald at ziesig.org
Thu Jul 21 23:37:54 CEST 2016


On 07/21/2016 03:44 PM, Mattias Gaertner wrote:
> On Thu, 21 Jul 2016 15:35:51 -0400
> Donald Ziesig <donald at ziesig.org> wrote:
>
>> On 07/21/2016 03:21 PM, Mattias Gaertner wrote:
>>> On Thu, 21 Jul 2016 15:05:17 -0400
>>> Donald Ziesig <donald at ziesig.org> wrote:
>>>   
>>>> [...]
>>>> Question:  Do console mode programs have a "run loop"?.
>>> Synchronize requires that your main thread calls CheckSynchronize from
>>> time to time. The LCL does that in its loop.
>>>
>>>   
>>>> [...]
>>> Mattias
>> That made it work!  Thank you.  (Where is this documented?)
> In CheckSynchronize itself, but not in the wiki multithread tutorial. I
> added it there.
>
> Mattias

Cool!  Thanks again.


Now back to TFPTimer.  I got it working with a hack in 
TFPTimerThread.Execute:


As implemented it calls Synchronize(@T.Timer).  This does *not* work.  
In desperation I hacked it to call Queue(@T.Timer) and it works 
perfectly.  I understand the difference between Synchronize and Queue, 
but I sure don't know why Queue works and Synchronize doesn't in this 
case.  (Only on the PI,  I didn't try this on Linux Mint).


Don

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160721/75e2be57/attachment.html>


More information about the Lazarus mailing list