From owner-svn-src-all@FreeBSD.ORG Tue Dec 4 00:54:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8DB09C2; Tue, 4 Dec 2012 00:54:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7196F8FC14; Tue, 4 Dec 2012 00:54:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB40snSm001980; Tue, 4 Dec 2012 00:54:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB40snD5001979; Tue, 4 Dec 2012 00:54:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212040054.qB40snD5001979@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 4 Dec 2012 00:54:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243850 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Dec 2012 00:54:49 -0000 Author: kib Date: Tue Dec 4 00:54:49 2012 New Revision: 243850 URL: http://svnweb.freebsd.org/changeset/base/243850 Log: MFC r243341: Add a special meaning to the negative ticks argument for taskqueue_enqueue_timeout(). Do not rearm the callout if it is already armed and the ticks is negative. Otherwise rearm it to fire in abs(ticks) ticks in the future. Modified: stable/9/sys/kern/subr_taskqueue.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_taskqueue.c ============================================================================== --- stable/9/sys/kern/subr_taskqueue.c Tue Dec 4 00:53:20 2012 (r243849) +++ stable/9/sys/kern/subr_taskqueue.c Tue Dec 4 00:54:49 2012 (r243850) @@ -252,9 +252,13 @@ taskqueue_enqueue_timeout(struct taskque } else { queue->tq_callouts++; timeout_task->f |= DT_CALLOUT_ARMED; + if (ticks < 0) + ticks = -ticks; /* Ignore overflow. */ + } + if (ticks > 0) { + callout_reset(&timeout_task->c, ticks, + taskqueue_timeout_func, timeout_task); } - callout_reset(&timeout_task->c, ticks, taskqueue_timeout_func, - timeout_task); } TQ_UNLOCK(queue); return (res);