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-
You should only access VCL objects from main VCL thread.
Some reading methods (property getters) do work from other threads in practice - but you have to prove it in advance reading VCL sources for the specific Delphi build. Or not use it.
PS: Synchronize method runs given procedure in main VCL thread, pausing the caller thread, which may lead to a deadlock, if main thread was also blocked.
Read more: (actually making this answer to list some links)