Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Sep : Re: TIdTCPServer shutdown

www.cryer.info
Managed Newsgroup Archive

Re: TIdTCPServer shutdown

Subject:Re: TIdTCPServer shutdown
Posted by:"Toby Piper" (ne..@compcraft.com)
Date:Fri, 14 Sep 2007 15:19:31

> That will never work safely.  You can't protect UI resources from the main
> thread like that, because the main thread does not participate in the
> critical section for its own accesses.  So you have to access the UI
> indirectly using a synched operation.  That way, it is always accessed in
> the context of the main thread, never in the context of a worker thread.

Oh, then I totally misunderstood what I read about Critical sections - or
the writer was incorrect - because I understood it to say that the critical
section was run in the main threads - ummm - thread. So it would be safe.

If I understand what you are saying then the critical section only applies
to worker threads - yes?

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive