lkml.org 
[lkml]   [2006]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] PI-futex: -V2

* Andrew Morton <akpm@osdl.org> wrote:

> Ingo Molnar <mingo@elte.hu> wrote:
> >
> > > > + for (;;) {
> > > > + if (top_waiter)
> > > > + plist_del(&top_waiter->pi_list_entry,
> > > > + &owner->pi_waiters);
> > > > +
> > > > + if (waiter && waiter == rt_mutex_top_waiter(lock)) {
> > >
> > > rt_mutex_top_waiter() can never return NULL, so the test for NULL
> > > could be removed.
> >
> > it might be NULL if adjust_pi_chain() is called from remove_waiter(),
> > and next_waiter there is NULL (because !rt_mutex_has_waiters() after the
> > removal of the current waiter).
>
> Yes, `waiter' might be NULL. But rt_mutex_top_waiter() will never
> return NULL. So it might be possible to just do
>
> if (waiter == rt_mutex_top_waiter(lock))

ah, indeed, you are right.

> Which might actually be less efficient, and more obscure. Just
> pointing it out.

ok, i left it as-is for now.

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-27 01:35    [W:0.075 / U:1.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site