Search code examples
c++builderindyvclc++builder-12-athens

Is TControlList::Invalidate() thread safe?


If I call MainForm->ControlList1->Invalidate() from a TIdUDPServer::>OnUDPRead event, is it thread safe, or do I still need to use TThread::Synchronize() or TThread::Queue()?


Solution

  • The TIdUDPServer::OnUDPRead event is synchronized by default, so any code you put inside of that event handler will be thread-safe as far as UI access is concerned.

    You can disable that synchronization by setting the TIdUDPServer::ThreadedEvent property to true.