This is the mail archive of the ecos-discuss@sourceware.cygnus.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: drv_lock() cond_wait() drv_unlock() sequence


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]