Re: arca-1-against-pre-2.1.127-3

Finn Arne Gangstad (finnag@guardian.no)
Mon, 2 Nov 1998 20:51:58 +0100 (MET)


On Mon, 2 Nov 1998, Kenneth Albanowski wrote:

> On Mon, 2 Nov 1998, Andrea Arcangeli wrote:
>
> > On Mon, 2 Nov 1998, Gerard Roudier wrote:
> >
> > >Here is the bug report:
> >
> > I just put out a new arca-6 with a more high level (and fixed) approch to
> > check if the timer is pending.
>
> On a related topic, back in 2.0.x, I've felt the lack of an atomic "start
> timer with given time if not running. If already running, don't touch it"
> function. A function that does this reliably (even with interrupts on)
> would be appreciated.

This should do the trick, but is maybe slightly ugly:

if (!del_timer(timer)) {
/* It wasn't running, give it a good expires value */
timer->expires = whenever;
}
add_timer(timer);

- Finn Arne

-
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/