From owner-cvs-all@FreeBSD.ORG Mon Aug 4 15:33:16 2008 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C46F106566C; Mon, 4 Aug 2008 15:33:16 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 1247B8FC0C; Mon, 4 Aug 2008 15:33:16 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id m74FXFsl041844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Aug 2008 08:33:15 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <4897213B.1000603@freebsd.org> Date: Mon, 04 Aug 2008 08:33:15 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: John Baldwin References: <200808021742.m72HgdBX031929@svn.freebsd.org> <200808040926.25626.jhb@freebsd.org> In-Reply-To: <200808040926.25626.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: svn commit: r181191 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2008 15:33:16 -0000 John Baldwin wrote: > On Saturday 02 August 2008 01:42:39 pm Sam Leffler wrote: > >> Author: sam >> Date: Sat Aug 2 17:42:38 2008 >> New Revision: 181191 >> URL: http://svn.freebsd.org/changeset/base/181191 >> >> Log: >> add callout_schedule; besides being useful it also improves >> compatibility with other systems >> >> Reviewed by: ed, battlez >> > > I think it probably warrants a KASSERT() that c_func isn't NULL to catch the > case of someone doing: > > callout_init(...); > > callout_schedule(...); > Sure, go for it. This was just the N'th time I'd noticed callout_schedule was missing when bringing code over from another system... > I'd almost prefer that we add (func, arg) pointers to the init routines so you > do this: > > callout_init_mtx(&sc->timer, &sc->lock, timer_func, sc); > > ... > > callout_schedule(&sc->timer, hz); > > Right now you have to make sure you do at least one 'callout_reset' before you > do a 'callout_schedule' which seems bug-prone. > > In most cases this is the more natural usage. It binds the callback to the timer while the current api provides an independent timer object that you can bind multiple callbacks to. I wasn't trying to change the existing model. I can't recall what phk's new api looks like in this regard. Sam