http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46096

--- Comment #9 from Danilo <zweifel at gmail dot com> 2010-10-20 14:43:18 UTC 
---
(In reply to comment #7)
> > Using a mutex around the reads and writes of shared data will make it work 
> > as
> > expected, the compiler won't optimise away the read and will re-read the 
> > value
> > every time.
> 
> This is overkill here though, you just need:
> 
>   volatile alpha *alpha1 = ( alpha * )data;

This solved it! Did not know about volatile variables. I was trying to avoid
exactly the use of mutexes and the like.

Thank you very much!

Reply via email to