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

Grant Edwards grante@visi.com
Tue Apr 4 16:24:00 GMT 2000


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.

-- 
Grant Edwards
grante@visi.com


More information about the Ecos-discuss mailing list