From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 26 20:24:06 2013 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12A758FA; Tue, 26 Nov 2013 20:24:06 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 387252A9A; Tue, 26 Nov 2013 20:24:04 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA18959; Tue, 26 Nov 2013 22:24:03 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1VlPAx-0001Xc-5O; Tue, 26 Nov 2013 22:24:03 +0200 Message-ID: <5295032B.4010200@FreeBSD.org> Date: Tue, 26 Nov 2013 22:23:07 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: freebsd-hackers@FreeBSD.org Subject: Re: taskqueue_drain_all References: <525519F1.3050703@FreeBSD.org> In-Reply-To: <525519F1.3050703@FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=x-viet-vps Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Nov 2013 20:24:06 -0000 on 09/10/2013 11:55 Andriy Gapon said the following: > > I would like to propose to extend taskqueue API with taskqueue_drain_all. > A potential use case: I have a private taskqueue, several kinds of tasks get > executed via it and then I want to make sure that all of them are completed. > Obviously, I have a way to ensure that no new ones get enqueued. Provided I do not get any no-s or why-s I am going to commit the following slightly different version soon: http://people.freebsd.org/~avg/taskqueue_drain_all.diff P.S. taskqueue_drain_running introduced in the above patch could also be used to add wait semantics to taskqueue_block. -- Andriy Gapon