6.0-BETA2: taskqueue_drain for if_xl.c:2796

John Baldwin jhb at FreeBSD.org
Wed Aug 17 20:20:51 GMT 2005

On Wednesday 17 August 2005 04:04 pm, Scott Long wrote:
> >>I do think that taskqueue_stop() is a muddying of the API.  If anyone
> >>else has a comment on this (BDE?) I would be very interested to hear it.
> >
> > *shrug*  It's already confusing in that callout_drain() does both a stop
> > and then wait kind of like pthread_cancel() whereas taskqueue_drain()
> > just waits until the task has run and finished without trying to cancel
> > it like pthread_join().  I'd actually probably be inclined to rename
> > callout_drain() to something else if we wanted to resolve that specific
> > instance of confusion personally.
> True, consistency would be nice =-)  Would you rather change
> taskqueue_drain() to be more like callout_drain()?

I don't think so.  It can be useful to fire off an async event and then wait 
for it to complete when you still definitely want it to run.

John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org

More information about the freebsd-current mailing list