When you call
Synchronize the related code runs in the main forms context. In your case
DoIt doesn't run in the context of the thread but in the context of your main form. You shoukd only call
Synchronize if you want to
access your main form for updating displayed data.