[ECOS] drv_lock() cond_wait() drv_unlock() sequence

Gary Thomas gthomas@redhat.com
Tue Apr 4 17:04:00 GMT 2000


On 04-Apr-00 Grant Edwards wrote:
> On Tue, Apr 04, 2000 at 05:14:58PM -0600, Gary Thomas wrote:
> 
>> >   cyg_drv_mutex_lock(&mtx)
>> >   cyg_drv_dsr_lock();
>> >   while (1)
>> >     {
>> >     if (done)
>> >        break;
>> >     else
>> >        cyg_drv_cond_wait(&cv);
>> >     }
>> >   cyg_drv_dsr_unlock();
>> >   cyg_drv_mutex_unlock(&mtx);  
>> 
>> cyg_drv_cond_wait() does an implicit scheduler unlock/relock
>> sequence, so the operation layout above does work.
> 
> Thanks. 
> 
> I knew the above sequence worked, so I figured it must. do a
> dsr unlock/lock. Adding a note to that effect to the
> description of drv_cond_wait() would proabably be a good idea.
> 

Of course.  The other thing is that users can do what I did - look
at the sources :-)  


More information about the Ecos-discuss mailing list