Kilho.net
IT

Delphi'de thread kullanımı

Delphi’de thread kullanmanın kolay bir yolu.

synchronize’ı doğru kullanmanız yeterli 🙂

Fonksiyon içeriği

[code lang=”delphi”]
uses System.Classes, System.SysUtils, Vcl.Forms;

procedure Wait(Proc: TProc);
var
Thread: TThread;
begin
Thread := TThread.CreateAnonymousThread(procedure()
begin
Proc;
end);
Thread.FreeOnTerminate := True;
Thread.Start;
while not Thread.Finished do Application.ProcessMessages;
end;
[/code]

Kullanım

[code lang=”delphi”]
Wait(procedure()
begin
// …. 내용
end);
[/code]

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir