Messages in this thread | | | Date | Mon, 27 Mar 2006 01:30:00 +0200 | From | Ingo Molnar <> | Subject | Re: [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/
| |