lkml.org 
[lkml]   [2015]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/4] wait.[ch]: Introduce the simple waitqueue (swait) implementation
On Mon, Oct 26, 2015 at 08:04:26PM +0800, Boqun Feng wrote:
> Hi Daniel,
>
> On Tue, Oct 20, 2015 at 09:28:07AM +0200, Daniel Wagner wrote:
> > +
> > +/*
> > + * The thing about the wake_up_state() return value; I think we can ignore it.
> > + *
> > + * If for some reason it would return 0, that means the previously waiting
> > + * task is already running, so it will observe condition true (or has already).
> > + */
> > +void swake_up_locked(struct swait_queue_head *q)
> > +{
> > + struct swait_queue *curr;
> > +
> > + list_for_each_entry(curr, &q->task_list, task_list) {
> > + wake_up_process(curr->task);
> > + list_del_init(&curr->task_list);
> > + break;
>
> Just be curious, what's this break for? Or what's this loop(?) for?

Lazy way of writing: if (!empty) { curr = first-entry;


\
 
 \ /
  Last update: 2015-10-26 14:01    [W:0.160 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site