lkml.org 
[lkml]   [2011]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] misc: add CARMA DATA-FPGA Access Driver
On Tue, Feb 08, 2011 at 11:11:44AM -0800, Ira W. Snyder wrote:
> On Tue, Feb 08, 2011 at 09:50:29AM -0800, Dmitry Torokhov wrote:
> > On Tue, Feb 08, 2011 at 09:20:46AM -0800, Ira W. Snyder wrote:
> >
> > > Go back and re-think my loop. This is a
> > > common idiom straight of out LDD3 pages 153-154.
> > >
> > > You should note that it is only possible to exit the loop with the lock
> > > held AND !list_empty(used). The lock protects the used list, and
> > > therefore, there must be a buffer on the list.
> >
> > No, because you are woken up while not holding the lock so another
> > reader is free to take it off the list.
> >
>
> Correct. But then I go around the loop and check list_empty() again
> before exiting the loop. The list MUST NOT be empty before the loop will
> terminate.

Yes, you are right, I competely missed the fact that we'd loop around
and check the condition again. I'll go grab another coffee now.

--
Dmitry


\
 
 \ /
  Last update: 2011-02-08 20:35    [W:0.042 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site