[fpc-pascal] Getting the state of a TRTLCriticalSection

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Mon Oct 7 09:14:22 CEST 2013

Benito van der Zander wrote:
>> In the end I stuck in code to increment/decrement a counter, and 
>> looked for it to be explicitly 0 or 1.
> Do you need to put a memory barrier around that, or does the critical 
> section take care of that?

I used the interlocked increment/decrement, which- as I understand it- 
should handle membar itself on architectures that can benefit from it.

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the fpc-pascal mailing list