[Lazarus] android: debugln and thread

Benito van der Zander benito at benibela.de
Thu May 9 00:37:53 CEST 2013


Hi,
does anyone know why creating a new thread breaks DebugLn? (till the 
execution returns to the JVM, Android, emulator, x86, )

This for example prints only "Started" to the log nothing else.
But the thread is called and executed correctly (otherwise it would stay 
forever in the waiting part)

var threadActivated: boolean = false; //global variable

procedure testCalledByJVM;
begin
   DebugLn('Started');
   TTestThread.Create(false);
   DebugLn('Waiting');
   while not threadActivated do begin sleep(200); DebugLn(' .. Waiting 
.. '); end;
   debugln('Done');
end;


type
  TTestThread = class(TThread)
   procedure Execute; override;
end;


  procedure TTestThread.Execute;
  begin
    debugln('THREAD TEST'); //including/excluding this line has no effect
    threadActivated:=true;
end;



Benito




More information about the Lazarus mailing list