Steven Seeger wrote:
 > 
 > 
 > > -----Original Message-----
 > > From: Steven Seeger
 > > Sent: Sunday, February 03, 2008 12:01 PM
 > > To: 'Gilles Chanteperdrix'
 > > Subject: RE: [Xenomai-help] periodic task question
 > > 
 > > I guess I don't see the difference here. I lock the mutex first, and
 > then
 > > wait on the conditional. The only time that conditional is ever
 > signaled
 > > is after something else sets playing to non-zero. (This code actually
 > > clears playing after locking that mutex, however I didn't put that in
 > > here.)

It was a general advice, not a proposed fix for the bug you observe.
By locking the mutex when reading or writing the "playing" variable, you
ensure that nobody else will be changing the "playing" variable while you
look at it and hence you will not miss any wake up. By running
rt_cond_wait in a while loop, you cause your thread to go to sleep in
case of spurious wake up.


-- 


                                            Gilles Chanteperdrix.

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to