[fpc-pascal] Critical Section and Recursive Calls

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Mar 30 09:17:19 CEST 2017


On Thu, 30 Mar 2017 03:36:02 -0300
African Wild Dog <paintedlycaon at gmail.com> wrote:

> Hello,
> 
> I'm writing a function protected by a critical section which can have
> recursive calls under certain conditions.
> 
> Using the TCriticalSection class, after my thread acquires a critical
> section, if my thread make 6 additional calls to TCriticalSection.Enter, to
> release the critical section my thread will have to make 6 additional calls
> to TCriticalSection.Leave?

Yes.

 
> If so, is this behaviour the same on all platforms?

Yes.

Mattias



More information about the fpc-pascal mailing list