|
|
|
| auThread component.
|
| procedure Synchronize(Method: TThreadMethod);
|
| The Synchronize method executes a method call within the main VCL thread. Synchronize causes the call specified by Method to be executed using the main VCL thread, thereby avoiding multi-thread conflicts. If you are unsure whether a method call is thread-safe, call it from within the main VCL thread by passing it to the Synchronize or SynchronizeEx methods.
|
|
|
| procedure TForm1.SynchronizedOutput;
|
| begin
|
| OutputBox1.Items.Add(Variable1);
|
| Label1.Caption := Variable2;
|
| end;
|
|
|
| procedure TForm1.auThread1Execute(Sender: TObject);
|
| begin
|
| //...
|
| StrVariable := StrData1;
|
| IntVariable := IntData2;
|
| Synchronize(SynchronizedOutput);
|
| //...
|
| end;
|
| Execute, Suspend, Resume and Terminate methods.
|