[fpc-devel] volatile variables
DrDiettrich1 at aol.com
Tue Jun 28 18:42:18 CEST 2011
Jonas Maebe schrieb:
>> 2.) Blocking access as described in 4.11 does not address execution
> It does guarantee that if T1 locks the mutex, changes the value, unlocks
> the mutex [...]
Can you explain please, to what "changes the value" applies?
I could not find a definition of the mutex struct, to determine whether
it contains any user-alterable values. When "the value" is declared
outside the mutex struct, it will be accessible also *without* locking
the mutex first.
However I can imagine that some mutex derived *class* (TCriticalSection)
can have additional fields, that are inaccessible until some code
obtains the mutex (similar to TThreadList). Otherwise a mutex cannot
protect anything but itself.
More information about the fpc-devel