From owner-freebsd-arch@FreeBSD.ORG Sun Jul 13 14:11:52 2014 Return-Path: Delivered-To: freebsd-arch@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 9B7DA406; Sun, 13 Jul 2014 14:11:52 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 597DC2A18; Sun, 13 Jul 2014 14:11:51 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id CCCB21FE027; Sun, 13 Jul 2014 16:11:48 +0200 (CEST) Message-ID: <53C293AC.9020006@selasky.org> Date: Sun, 13 Jul 2014 16:11:56 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Benjamin Kaduk , John-Mark Gurney Subject: Re: callout(9) really this complicated? References: <20140704041521.GW45513@funkthat.com> <201407091211.47642.jhb@freebsd.org> <20140710061955.GT45513@funkthat.com> <201407101530.32533.jhb@freebsd.org> <20140711023749.GA45513@funkthat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2014 14:11:52 -0000 On 07/11/14 17:28, Benjamin Kaduk wrote: > [large pile of context trimmed] > > On Thu, 10 Jul 2014, John-Mark Gurney wrote: > >> Ok, I'm so confused now that I will NOT be creating a patch, and unless >> someone comes up w/ a patch to clarify it, I will add to the description >> that there are numerous misleading statements in this man page and link >> them to this thread... > > I have saved jhb's messages in this thread and added to my TODO list to > make a pass through this man page. There's quite a few things in front > of this in my list, though -- I don't expect to have anything for maybe > a month. > Hi, One additional comment: The "callout_drain()" function also ensures that not only the function callback is no longer called/executing, but also that the mutex which is passed as an argument to callout_init_mtx() is no longer being used. Maybe the "start/stop/drain" theorem could be explained in general somewhere, because the USB stack works similarly, and I believe it is the correct way to implement more advanced callback API's in a multithreaded system. --HPS