Subject: Re: timedwork
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Andrew Doran <ad@netbsd.org>
List: tech-kern
Date: 01/13/2007 17:31:59
Hi,

On Sat, Jan 13, 2007 at 09:11:06PM +0900, YAMAMOTO Takashi wrote:

> > I'm thinking something like:
> > 
> > 	callout_init(&c);
> > 	callout_setwork(&c, func, arg);
> > 	callout_schedule(&c, timeout);
> 
> i implemented it.  see the attached patch.
> 
> once callout_setwork() is called on a callout,
> callout_schedule() is only legal operation on the callout.
> (i'm not a fan of making primitives have rich functionalities...)

I would prefer not to have a seperate callout_setwork(), but instead
a flag to callout_init that can be ignored if we later do interrupts
as threads:

	callout_init(&foo, CALLOUT_THREAD);

We will need to add a CALLOUT_MPSAFE flag at some point.

Andrew