Forum > General

[SOLVED] CreateThread + String/Dynamic array inside thread proc = SIGSEGV crash

<< < (2/2)

Syndrome:
Thanks everyone for their help.
lazarus doesnt support windows.createthread function
here is solution for threads:

--- Code: ---function SecondThread( dummy:pointer ):ptrint;
var
   s:string;
   d:array of byte;
begin
   while true do begin
      s:= 'asd'+inttostr(222);
      setlength(d,10);
      d[4]:= d[2];
      sleep(10000);
   end;
end;

procedure TForm1.FormCreate(Sender:TObject);
begin
   beginthread(@secondthread,nil);
end;

--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version