Subject: Re: callout question
To: Daniel <>
From: Nathan J. Williams <>
List: tech-kern
Date: 11/26/2001 08:56:02
Daniel <> writes:

> Do you have to call callout_init() before each callout_reset()?

No. Look at the setitimer() code in kern/kern_time.c for an example;
it calls callout_reset() repeatedly, but only calls callout_init() once.

> What will happen if you call callout_init() and pass an already
> initialized callout structure?

If it's only initialized, and not currently active, nothing bad will
happen. If it is on a callout queue (active and has not yet fired),
very bad things can happen, as you will trash one of the linked lists
of callouts. Don't do that.

        - Nathan