Re: [patch] wake_one for accept(2) [was Re: Overscheduling DOES happen with high web server load.]

Jan Echternach (echter@informatik.uni-rostock.de)
Tue, 11 May 1999 10:12:51 +0200


On Tue, May 11, 1999 at 08:07:26AM +0200, Pauline Middelink wrote:
> On Tue, May 11, 1999 at 12:58:46AM -0700, David S. Miller wrote:
> > + if (t->state & TASK_INTERRUPTIBLE && signal_pending(t))
> >
> > Andrea, watch out! The presedence rules of C have bitten you here.
> >
> > You want:
> >
> > + if ((t->state & TASK_INTERRUPTIBLE) && signal_pending(t))
> >
> Syntactic sugar, the precedence of & is higher than that of &&
> (The C programming language, pp. 53 second edition)

You are right.

There are, however, other cases like (a & b == c) being equivalent to
(a & (b == c)).

Obviously, some precedence rules are not clear to everybody. Therefore I
strongly recommend to use the parentheses.

-- 
Jan

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