On 15.10.2011 01:01, andrew.benn...@ns.sympatico.ca wrote:
As part of an attempt at multi-threading, I have had to move
many things that used to be global into the Implementation
parts of units in order to enforce privacy. When I moved a
routine passed as a parameter and put it inside the routine
to be threaded, the program ceased to work. I append the
essential code abstracted from my program:

[snip]
What am I doing wrong?

As Ludo wrote local procedures/functions are not supposed to be passed around as function pointers. In trunk and the upcoming 2.6 there is a possibilty though: nested procedure variables.

For a description you can take a look at this commit message:
http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&revision=15694

Especially take a look at the tests in tests/test/tmaclocalprocparam* mentioned in the commit log for examples of this feature.

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to