summaryrefslogtreecommitdiffstats
path: root/share/man/man9/timeout.9
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2008-08-02 17:42:38 +0000
committersam <sam@FreeBSD.org>2008-08-02 17:42:38 +0000
commitf28149353a8d84e6d26ce1feac18f3225125ceaf (patch)
tree48979d511003bfcad58592aad5b0356bc70e5cb0 /share/man/man9/timeout.9
parentdd6ada0389c465aff31058de6e40459dc9fc559b (diff)
downloadFreeBSD-src-f28149353a8d84e6d26ce1feac18f3225125ceaf.zip
FreeBSD-src-f28149353a8d84e6d26ce1feac18f3225125ceaf.tar.gz
add callout_schedule; besides being useful it also improves
compatibility with other systems Reviewed by: ed, battlez
Diffstat (limited to 'share/man/man9/timeout.9')
-rw-r--r--share/man/man9/timeout.926
1 files changed, 21 insertions, 5 deletions
diff --git a/share/man/man9/timeout.9 b/share/man/man9/timeout.9
index 9c37632..e6d911d 100644
--- a/share/man/man9/timeout.9
+++ b/share/man/man9/timeout.9
@@ -36,7 +36,7 @@
.\"
.\" $FreeBSD$
.\"
-.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 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALIZER(&handle)
.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 @@ The functions
.Fn callout_init_mtx ,
.Fn callout_init_rw ,
.Fn callout_stop ,
-.Fn callout_drain
-and
+.Fn callout_drain ,
.Fn callout_reset
+and
+.Fn callout_schedule
are low-level routines for clients who wish to allocate their own
callout structures.
.Pp
@@ -201,9 +205,10 @@ The function
.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 @@ If there was already a pending callout and it was rescheduled, then
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 ,
OpenPOWER on IntegriCloud