----- Ursprüngliche Mail -----
> Von: "Florian Bezdeka" <florian.bezd...@siemens.com>
>> ...same does marking both variables as volatile.
> 
> I don't have much context here, but volatile sounds like a valid
> solution (assuming that safety is written by a different thread)

Both variables are written by the very same thread.
The problem is that the don't get used later, so the compiler is free
to remove the loop. That's why the barrier fixes the problem.
It forces the compiler to keep the loop.

Thanks,
//richard

Reply via email to