From owner-freebsd-current@FreeBSD.ORG Thu Feb 27 11:02:42 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 756E2526 for ; Thu, 27 Feb 2014 11:02:42 +0000 (UTC) Received: from mta05.bitpro.no (mta05.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 2BE9D19A5 for ; Thu, 27 Feb 2014 11:02:41 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta05.bitpro.no (Postfix) with ESMTPS id 329C317FFA3; Thu, 27 Feb 2014 12:02:40 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 94566181B01; Thu, 27 Feb 2014 12:03:38 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id anh93m+Sanea; Thu, 27 Feb 2014 12:03:37 +0100 (CET) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id 8342D181AE7; Thu, 27 Feb 2014 12:03:37 +0100 (CET) Message-ID: <530F1B81.807@bitfrost.no> Date: Thu, 27 Feb 2014 12:03:29 +0100 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Kohji Okuno , jmg@funkthat.com Subject: Re: kqueue for KBD. References: <20140227.142445.47188371497615592.okuno.kohji@jp.panasonic.com> <20140227061840.GB47921@funkthat.com> <20140227.195956.1191893338998586416.okuno.kohji@jp.panasonic.com> In-Reply-To: <20140227.195956.1191893338998586416.okuno.kohji@jp.panasonic.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 11:02:42 -0000 On 02/27/14 11:59, Kohji Okuno wrote: > + sc = kbd->kb_dev->si_drv1; > + knlist_clear(&sc->gkb_rsel.si_note, 0); > + knlist_destroy(&sc->gkb_rsel.si_note); > + > free(kbd->kb_dev->si_drv1, M_DEVBUF); > destroy_dev(kbd->kb_dev); Hi, You should put the "knlist_destroy()" after the "destroy_dev()" and leave out the "knlist_clear()" I think! Because "destroy_dev()" is a synchronous function which ensure that all character device refs are gone including knotes, if I'm not mistaken. --HPS