Re: Getting a ThreadList without locking (TIdTCPServer)

From: Dean (dean_at_[spambuster)
Date: 01/16/04


Date: Fri, 16 Jan 2004 09:28:38 -0000

Anyone?

"Dean" <dean[no-spam]@weany.com> wrote in message
news:4006c5f0$3@newsgroups.borland.com...
> Thanks Rob,
>
> In which case, as an alternative (as I know eactly which threads I want to
> mutex) can I call a lock to a select number of the threads only?
>
> I can maintain my own TList of pointers for reference, then I just want to
> keep those threads only out of this specific procedure.
>
> Thanks,
>
> D
>
> "Rob Kennedy" <.> wrote in message news:4006be0a@newsgroups.borland.com...
> > Dean wrote:
> > > Is there a way I can get a TList of pointers to TIdPeerThreads
currently
> > > active on TIdTCPServer without actually calling the mutex and locking
> the
> > > threads?
> > >
> > > Or do I have to do:-
> > >
> > > var List : TList;
> > > begin
> > > List := MyServer.Threads.Lock;
> > > MyServer.Threads.Unlock;
> >
> > You could do that, but as soon as you do, the state of the list will be
> > unpredictable. Some other thread might add or remove items from the list
> > while this thread is using it unprotected.
> >
> > --
> > Rob
>
>



Relevant Pages

  • Re: Troubles with Mkdir - WAS: Folder locked when using Open Statement twice
    ... wildcards). ... and will release the lock. ... Rob ... Prev by Date: ...
    (microsoft.public.vb.bugs)
  • Re: Damage using Cable Locks
    ... Rob F wrote: ... #A friend bought a new 870 from a local shop and since the long gun did ... #not include any lock he used a freebie lock from the police station. ... Since he had no recipt they would not release the gun to him ...
    (rec.guns)
  • RE: fn key
    ... Thanks Rob. ... numbers lock. ... symbol that looks like a keyboard and press ... >letters when typing. ...
    (microsoft.public.windowsxp.general)
  • Krypto lock phone number?
    ... Kryptonites websites been down for a while now. ... procedure or phone number for returning an old U lock for replacement. ... Rob ...
    (rec.bicycles.misc)
  • Re: WaitForSingleObject() will not deadlock
    ... You keep talking about needing to know the reference count. ... algorithm that uses a recursive mutex that cares in the slightest what the reference count ... attempts to lock appears to be isomorphic to a recursive lock, ... cycle detection until you reach the end of the list, ...
    (microsoft.public.vc.mfc)