[fpc-devel] Extension request to TThread extensions

Michael Van Canneyt michael at freepascal.org
Wed Aug 20 12:14:53 CEST 2014



On Wed, 20 Aug 2014, Michael Schnell wrote:

> On 08/20/2014 11:12 AM, Michael Van Canneyt wrote:
>
>> You can perfectly work around this by implementing 
>> Application.QueueAsnycCall so that it creates a thread which does the call 
>> to TThread.Queue.
>
> Do you mean that for an implementation of "Application.QueueAsyncCall" I 
> should
> - Check if we are in the Main thread
> - if yes create a Dummy TThread
> - in the Execute procedure of the TThread do nothing but call TThread.Queue
> - have the TThread terminate itself and free the TThread object.
>
> ?

Yes.

> I agree that this is possible but for me it is a decently clumsy workaround.
>
> OTOH, as supposedly nobody ever on purpose  calls Application.QueueAsyncCall 
> from the main thread it does not do much harm (other than eating up some 
> bytes of memory).

Exactly.

Michael.



More information about the fpc-devel mailing list