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

Philippe Lévi Philippe at quarta.com.br
Mon Feb 23 19:38:05 CET 2015


what you want to do makes sense? I don't think so. Thread code "may not" access stack values of calling code ...


________________________________
De: fpc-pascal-bounces at lists.freepascal.org <fpc-pascal-bounces at lists.freepascal.org> em nome de silvioprog <silvioprog at gmail.com>
Enviado: segunda-feira, 23 de fevereiro de 2015 15:32
Para: FPC-Pascal users discussions
Assunto: Re: [fpc-pascal] TThread.Queue vs TThread.Synchronize

On Mon, Feb 23, 2015 at 3:23 PM, Sven Barth <pascaldragon at googlemail.com<mailto:pascaldragon at googlemail.com>> wrote:
[...]=== code begin ===

procedure TMyThread.Execute;
var
  s: String;

  procedure SyncOnPrint;
  begin
    fOnPrint(s);
  end;

begin
  s := 'Hello World';
  Queue(@SyncOnPrint);
end;

=== code end ===

How to compile it?:

Error: Incompatible type for arg no. 1: Got "<address of procedure is nested;Register>", expected "<procedure variable type of procedure of object;Register>".

--
Silvio Clécio
My public projects - github.com/silvioprog<http://github.com/silvioprog>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150223/ac130f80/attachment.html>


More information about the fpc-pascal mailing list