This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
Re: drv_lock() cond_wait() drv_unlock() sequence
- To: Grant Edwards <grante at visi dot com>
- Subject: Re: [ECOS] drv_lock() cond_wait() drv_unlock() sequence
- From: Gary Thomas <gthomas at redhat dot com>
- Date: Tue, 04 Apr 2000 18:04:48 -0600 (MDT)
- Cc: ecos-discuss at sourceware dot cygnus dot com
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 :-)