From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 4 09:39:36 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B668116A473 for ; Mon, 4 Jun 2007 09:39:36 +0000 (UTC) (envelope-from Artis.Caune@latnet.lv) Received: from esbens.latnet.lv (esbens.latnet.lv [159.148.19.115]) by mx1.freebsd.org (Postfix) with ESMTP id 64B6A13C4C8 for ; Mon, 4 Jun 2007 09:39:36 +0000 (UTC) (envelope-from Artis.Caune@latnet.lv) Received: from localhost (localhost.localdomain [127.0.0.1]) by esbens.latnet.lv (Postfix) with ESMTP id AEC481743B6 for ; Mon, 4 Jun 2007 12:39:34 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at esbens.latnet.lv Received: from esbens.latnet.lv ([127.0.0.1]) by localhost (esbens.latnet.lv [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xdXfa8sktHkb for ; Mon, 4 Jun 2007 12:39:33 +0300 (EEST) Received: from [159.148.108.245] (didii.latnet.lv [159.148.108.245]) by esbens.latnet.lv (Postfix) with ESMTP id 2A49C139FE9 for ; Mon, 4 Jun 2007 12:39:33 +0300 (EEST) Message-ID: <4663DDD4.1020207@latnet.lv> Date: Mon, 04 Jun 2007 12:39:32 +0300 From: Artis Caune User-Agent: Thunderbird 1.5.0.10 (X11/20070327) MIME-Version: 1.0 To: hackers@freebsd.org References: <465FF29B.3010307@latnet.lv> <46604877.7030007@errno.com> In-Reply-To: <46604877.7030007@errno.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: stopping callouts X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2007 09:39:36 -0000 Sam Leffler wrote: > > If you use callout_init_mtx then use callout_stop while holding my_mtx; > if the callout is blocked waiting for my_mtx the request will be discarded. > > callout_drain should not be called while holding my_mtx because it can > sleep. > Thanks, than I will use: MTX_LOCK; ... callout_stop(); MTX_UNLOCK;