Thread-safe in delphi
问题 I have to modify and change some visual components in a thread and as you know it's not safe to doing this. My question is how to write a completely thread-safe code? It is possible? if it is then can you please give me a simple example? my code that is not threadsafe: type tMyWorkerThread = class(TThread) public procedure Execute; override; end; var Form1: TForm1; implementation {$R *.dfm} procedure tMyWorkerThread.Execute; begin //codes //working with visual components end; procedure TForm1