[fpc-pascal] TThread.Queue vs TThread.Synchronize

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Feb 24 10:48:38 CET 2015


On Tue, 24 Feb 2015 09:30:37 +0000
Graeme Geldenhuys <mailinglists at geldenhuys.co.uk> wrote:

> On 2015-02-23 19:49, Philippe Lévi wrote:
> > if code in thread access a local variable (in stack) of the function
> > where thread is issued ... it may access "something" which does not
> > exist any more. correct?
> 
> Good question, and what I was trying to get at with my second question
> on TThread.Queue usage. As Sven mentioned in his reply (and how I
> understood it, but needed confirmation), anonymous methods will solve
> that issue - once FPC supports anonymous method usage with TThread.Queue().

I think what you mean is "closure".
The functions don't need to be "anonymous" for that.

Mattias



More information about the fpc-pascal mailing list