On 07 Oct 2013, at 09:14, Mark Morgan Lloyd wrote:

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.

They do not include any memory barrier. The only thing those routines guarantee on all platforms, is that the value is atomically incremented/decremented.


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to