[Openal-devel] Some threading bits

Matias D'Ambrosio angasule at gmail.com
Thu Jul 10 18:43:59 PDT 2008



On Thursday 10 July 2008 22:13:56 Chris Robinson wrote:
> On Thursday 10 July 2008 11:13:12 am Matias D'Ambrosio wrote:
> >  I'm attaching a ridiculously short patch which I'm not even sure is
> > necessary. The variable killNow is an int (used as a boolean) in alsa.c ,
> > apparently to stop alsa processing while killing the thread. Shouldn't it
> > be a volatile?
>
> Is it legal to mark a single struct member as volatile, and not the whole
> struct itself? You're right that it should be volatile because of the
> threaded access, but I hope I don't have to make the whole struct volatile
> to do it..
 Yes, it's legal, though I didn't check the standard, and gcc didn't 
complain... :)
 Anyway, a mutex should be used there if it's really important (can it 
segfault? Or just causes noise?).


More information about the Openal-devel mailing list