summaryrefslogtreecommitdiffstats
path: root/share/man/man9/timeout.9
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-12-27 16:22:20 +0000
committerbde <bde@FreeBSD.org>1999-12-27 16:22:20 +0000
commit69a3e4e3c75dfb8ce1cfd87aed386d6538c7e2aa (patch)
tree22f1ce79fd2afb1c660335367e0588d0bef77a36 /share/man/man9/timeout.9
parenta6b139a8de4f6b214908c7156c954c50d2c46b06 (diff)
downloadFreeBSD-src-69a3e4e3c75dfb8ce1cfd87aed386d6538c7e2aa.zip
FreeBSD-src-69a3e4e3c75dfb8ce1cfd87aed386d6538c7e2aa.tar.gz
Fixed some bugs (one serious one: timeouts were claimed to be executed at
spl0) and some bitrot (the not-so-new callout_init/stop/reset functions were not mentioned; the callout_activate/deactivate/pending macros are still not mentioned). Submitted by: mostly by jlemon
Diffstat (limited to 'share/man/man9/timeout.9')
-rw-r--r--share/man/man9/timeout.945
1 files changed, 41 insertions, 4 deletions
diff --git a/share/man/man9/timeout.9 b/share/man/man9/timeout.9
index 0857d71..7e03734 100644
--- a/share/man/man9/timeout.9
+++ b/share/man/man9/timeout.9
@@ -50,11 +50,17 @@
.Ft struct callout_handle
.Fn timeout "timeout_t *func" "void *arg" "int ticks"
.Ft void
-.Fn callout_handle_init "struct callout_handle *"
+.Fn callout_handle_init "struct callout_handle *handle"
.Li struct callout_handle handle = CALLOUT_HANDLE_INITIALIZER(&handle)
.Ft void
.Fn untimeout "timeout_t *func" "void *arg" "struct callout_handle handle"
+.Ft void
+.Fn callout_init "struct callout *c"
+.Ft void
+.Fn callout_stop "struct callout *c"
+.Ft void
+.Fn callout_reset "struct callout *c" "int ticks" "timeout_t *func" "void *arg"
.Sh DESCRIPTION
The function
.Fn timeout
@@ -62,7 +68,8 @@ schedules a call to the function given by the argument
.Fa func
to take place after
.Fa ticks Ns No /hz
-seconds. Non-positive values of
+seconds.
+Non-positive values of
.Fa ticks
are silently converted to the value
.Sq 1 .
@@ -74,7 +81,7 @@ Upon invocation,
.Fa func
will receive
.Fa arg
-as it's only argument.
+as its only argument.
The return value from
.Fn timeout
is a
@@ -134,7 +141,37 @@ and
.Fn untimeout .
Timeouts are executed from
.Fn softclock
-at spl0 and are protected from re-entrancy.
+at
+.Fn splsoftclock .
+Thus they are protected from re-entrancy.
+.Pp
+The functions
+.Fn callout_init ,
+.Fn callout_stop
+and
+.Fn callout_reset
+are low-level routines for clients who wish to allocate their own
+callout structures.
+.Pp
+The function
+.Fn callout_init
+initializes a callout so it can be passed to
+.Fn callout_stop
+or
+.Fn callout_reset
+without any side effects.
+.Pp
+The function
+.Fn callout_stop
+cancels a callout if it is currently pending.
+.Pp
+The function
+.Fn callout_reset
+first calls
+.Fn callout_stop
+to disestablish the callout, and then establishes a new callout in the
+same manner as
+.Fn timeout .
.Sh HISTORY
The current timeout and untimeout routines are based on the work of
Adam M. Costello and George Varghese, published in a technical report entitled
OpenPOWER on IntegriCloud