Michael Van Canneyt wrote:
On Sun, 6 Oct 2013, Mark Morgan Lloyd wrote:

Is there a preferred way of reading back whether something (including the current thread) has already entered a TCriticalSection?

To my knowlede this does not exist.

The Microsoft implementation of a critical section has TryEnterCriticalSection, but I do not know how portable or useful that is.

I think that one's generally available, but it looks as though it does the same as TCriticalSection.TryEnter.

In the end I stuck in code to increment/decrement a counter, and looked for it to be explicitly 0 or 1.

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

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to