From owner-freebsd-arch@FreeBSD.ORG Tue Nov 14 18:31:52 2006 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8736516A47E for ; Tue, 14 Nov 2006 18:31:52 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E3E743D5E for ; Tue, 14 Nov 2006 18:31:47 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 22638170C0; Tue, 14 Nov 2006 18:31:46 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.13.8/8.13.8) with ESMTP id kAEIVjum012466; Tue, 14 Nov 2006 18:31:45 GMT (envelope-from phk@critter.freebsd.dk) To: Ricardo Nabinger Sanchez From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 14 Nov 2006 16:26:58 -0200." <20061114162658.ae168dcf.rnsanchez@wait4.org> Date: Tue, 14 Nov 2006 18:31:45 +0000 Message-ID: <12465.1163529105@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: arch@freebsd.org Subject: Re: a proposed callout API X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Nov 2006 18:31:52 -0000 In message <20061114162658.ae168dcf.rnsanchez@wait4.org>, Ricardo Nabinger Sanc hez writes: >On Mon, 13 Nov 2006 20:53:41 +0000 >Poul-Henning Kamp wrote: > >> XXX_disarm(struct xxx*) >> Unarm the timer. >> >> XXX_drain(struct xxx*) >> Drain the timer. > >One of these (or both) removes a callout from the tree? I don't quite >understand their differences. disarm disables the callout, it will not be called again after the disarm call returns, and it will not be rescheduled if it is currently running. drain does not return until the callout has completed running, if it is currently active. The two-phase teardown is necessary where a mutex is held during the callout execution. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.