In our previous episode, Michael Schnell said:
> On this behalf, "Application.QueuAsyncCall" is more versatile.
> 
> But it's easy with TThread.Queue, as well.
> 
>   - define  a class (not to be derived from TThread) that holds the data 
> to be transferred and a procedure without parameters
>   - create an instance of that class

(where to store that instance?)

>   - use TThread.Queue to have the said procedure be executed by the main 
> thread
>   - at the end of the said procedure do "free" (without a prefix) this 
> will make the instance remoce itself.

You need a full queue for that, since the mainthread might not run till the
thread next queue()'s.

I've a simple generic threadsafe queue that I use for that.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to