From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 1 10:41:38 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 8455F16A41F for ; Fri, 1 Jun 2007 10:41:38 +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 354DD13C43E for ; Fri, 1 Jun 2007 10:41:38 +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 BC72916C580 for ; Fri, 1 Jun 2007 13:19:45 +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 UrRTP8ORThgS for ; Fri, 1 Jun 2007 13:19:44 +0300 (EEST) Received: from [159.148.108.245] (didii.latnet.lv [159.148.108.245]) by esbens.latnet.lv (Postfix) with ESMTP id 8741316C577 for ; Fri, 1 Jun 2007 13:19:07 +0300 (EEST) Message-ID: <465FF29B.3010307@latnet.lv> Date: Fri, 01 Jun 2007 13:19:07 +0300 From: Artis Caune User-Agent: Thunderbird 1.5.0.10 (X11/20070327) MIME-Version: 1.0 To: hackers@FreeBSD.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: 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: Fri, 01 Jun 2007 10:41:38 -0000 Hello FreeBSD-hackers! what is the right way to stop callout which is initialized with mutex: callout_init_mtx(&callout_function, &my_mtx, 0); should I lock mutex before calling callout_drain() or not? man page says: callout_drain() is identical to callout_stop() and if the callout has an associated mutex, then that mutex must be held when callout_stop() is called. /* MOD_UNLOAD */ MTX_LOCK; callout_drain() MTX_UNLOCK;