On 08 Oct 2010, at 22:45, Andrew Brunner wrote: > On Fri, Oct 8, 2010 at 3:37 PM, Marco van de Voort <mar...@stack.nl> wrote: >> No, but the last one might be set before the condition coupled to that last >> one might be carried out. See Jonas' example. > > The ONLY way that could happen is if the boolean happens to be set in > a worker thread's method that still has more work to do.
That is incorrect. Even if you set the boolean only to true at the very end, problems can still occur. See e.g. http://en.wikipedia.org/wiki/Memory_barrier#An_illustrative_example for an example and explanation. Jonas
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal