[Lazarus] Compiling LCL for ARM fails at lconvencoding.pas
cc_ at freemail.hu
cc_ at freemail.hu
Fri May 9 22:38:37 CEST 2008
Hi !
I have to use threads in a GUI app.
I have a class which is descendant of TThread and Synchronize is used
to update all Visual controls.
However most of the functions are not within this class and it is
difficult to broadcast the current TThread var.
I would like to call TThread.Synchronize from anywhere but it requires
a value for AThread :
class procedure Synchronize(AThread: TThread; AMethod: TThreadMethod);
May be `threadvar` could help me but I don't know if it is a good idea
and if it is valid :
type
TMyThread = class(TThread)
protected
procedure Execute;override;
[...]
end;
threadvar
CurrentThread: TMyThread;
implementation
procedure TMyThread.Execute;
begin
CurrentThread := Self;
while not Terminated do
begin
// Loop
end;
end;
Any advice ?
--
Damien Gerard
milipili at shikami.org
"Intelligence is 10 million rules."
-- Douglas Lenat
More information about the Lazarus
mailing list