From owner-p4-projects@FreeBSD.ORG Sat Aug 2 17:16:03 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1FF1D10656A3; Sat, 2 Aug 2008 17:16:03 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6D67106568F for ; Sat, 2 Aug 2008 17:16:02 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C1CCF8FC2A for ; Sat, 2 Aug 2008 17:16:02 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m72HG22f052507 for ; Sat, 2 Aug 2008 17:16:02 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m72HG2Mb052505 for perforce@freebsd.org; Sat, 2 Aug 2008 17:16:02 GMT (envelope-from sam@freebsd.org) Date: Sat, 2 Aug 2008 17:16:02 GMT Message-Id: <200808021716.m72HG2Mb052505@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 146468 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2008 17:16:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=146468 Change 146468 by sam@sam_ebb on 2008/08/02 17:15:57 document callout_schedule Affected files ... .. //depot/projects/vap/share/man/man9/timeout.9#3 edit Differences ... ==== //depot/projects/vap/share/man/man9/timeout.9#3 (text+ko) ==== @@ -36,7 +36,7 @@ .\" .\" $FreeBSD: src/share/man/man9/timeout.9,v 1.32 2007/11/20 12:21:36 gabor Exp $ .\" -.Dd November 20, 2007 +.Dd August 2, 2008 .Dt TIMEOUT 9 .Os .Sh NAME @@ -49,6 +49,7 @@ .Nm callout_stop , .Nm callout_drain , .Nm callout_reset , +.Nm callout_schedule , .Nm callout_pending , .Nm callout_active , .Nm callout_deactivate @@ -83,6 +84,8 @@ .Ft int .Fn callout_reset "struct callout *c" "int ticks" "timeout_t *func" "void *arg" .Ft int +.Fn callout_schedule "struct callout *c" "int ticks" +.Ft int .Fn callout_pending "struct callout *c" .Ft int .Fn callout_active "struct callout *c" @@ -191,9 +194,10 @@ .Fn callout_init_mtx , .Fn callout_init_rw , .Fn callout_stop , -.Fn callout_drain +.Fn callout_drain , +.Fn callout_reset and -.Fn callout_reset +.Fn callout_schedule are low-level routines for clients who wish to allocate their own callout structures. .Pp @@ -201,9 +205,10 @@ .Fn callout_init initializes a callout so it can be passed to .Fn callout_stop , -.Fn callout_drain +.Fn callout_drain , +.Fn callout_reset or -.Fn callout_reset +.Fn callout_schedule without any side effects. If the .Fa mpsafe @@ -294,6 +299,17 @@ will return a non-zero value. If the callout has an associated mutex, then that mutex must be held when this function is called. +The function +.Fn callout_schedule +(re)schedules an existing callout for a new period of time; it is +equivalent to calling +.Fn callout_reset +with the +.Fa func +and +.Fa arg +parameters extracted from the callout structure (though possibly with +lower overhead). .Pp The macros .Fn callout_pending ,