[fpc-pascal] Getting the state of a TRTLCriticalSection
Benito van der Zander
benito at benibela.de
Sun Oct 6 19:40:08 CEST 2013
>
> 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?
On 10/06/2013 06:55 PM, Mark Morgan Lloyd wrote:
> 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.
>
More information about the fpc-pascal
mailing list