A critical section only locks out other threads.

So the first thread enters the method.
Subsequent calls from different threads are blocked - they go into an
efficient wait state, until the critical section lock is released. You do
not have to do anything.
Beware that the same thread can still call the method, hence you can get
recursion within a thread. This is done so that a thread does not block
itself.

Have fun.

Myles.

> -----Original Message-----
> From: Sergei Stenkov [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, July 19, 2000 12:22 PM
> To:   Multiple recipients of list delphi
> Subject:      [DUG]:  CriticalSection
> 
> Hello,
> 
> I have a few questions on usage of TCriticalSection. We have a Free
> apartment, Multi threaded COM app.
> 
> Suppose the first request locks data access with
> MyCriticalSection.Acquire.
> 
> What happens to the subsequent requests?
> 
> Do they get queued and resume execution after MyCriticalSection.Release?
> 
> Do they get aborted?
> 
> Do I have to do anything about their queuing?
> 
> Any help is greatly appreciated.
> 
> Best regards,
> 
> Sergei Stenkov
> 
> PayGlobal - the only payroll & HR solution you'll ever need
> www.payglobal.com
> ___________________________________
> 
> TimeMaster Systems Limited
> Level 3, 8 Nelson Street, PO Box 8198
> Riccarton, Christchurch, New Zealand
> Phone: 64 3 343 3835 Fax: 64 3 343 3953
> Email: [EMAIL PROTECTED]
> 
> 
> --------------------------------------------------------------------------
> -
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to