summaryrefslogtreecommitdiff
path: root/share/man
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-09-22 12:55:25 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-09-22 12:55:25 +0000
commit170a442702fc92692138f7d1d3e913a7e67dc134 (patch)
tree3cb0b96931c572435bc5944cb47b5f13b4a469ee /share/man
parentee79cc51762dffca44ed2c99ac0bf859e9a866e2 (diff)
Introduce a new 'softclock' thread that will be used to execute timeout
callbacks needing a process context. The function timeout_set_proc(9) has to be used instead of timeout_set(9) when a timeout callback needs a process context. Note that if such a timeout is waiting, understand sleeping, for a non negligible amount of time it might delay other timeouts needing a process context. dlg@ agrees with this as a temporary solution. Manpage tweaks from jmc@ ok kettenis@, bluhm@, mikeb@
Diffstat (limited to 'share/man')
-rw-r--r--share/man/man9/timeout.924
1 files changed, 19 insertions, 5 deletions
diff --git a/share/man/man9/timeout.9 b/share/man/man9/timeout.9
index 8701c920a2c..ec0c96d086f 100644
--- a/share/man/man9/timeout.9
+++ b/share/man/man9/timeout.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: timeout.9,v 1.43 2016/06/14 15:58:03 bluhm Exp $
+.\" $OpenBSD: timeout.9,v 1.44 2016/09/22 12:55:24 mpi Exp $
.\"
.\" Copyright (c) 2000 Artur Grabowski <art@openbsd.org>
.\" All rights reserved.
@@ -23,11 +23,12 @@
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: June 14 2016 $
+.Dd $Mdocdate: September 22 2016 $
.Dt TIMEOUT_SET 9
.Os
.Sh NAME
.Nm timeout_set ,
+.Nm timeout_set_proc ,
.Nm timeout_add ,
.Nm timeout_add_sec ,
.Nm timeout_add_msec ,
@@ -47,6 +48,8 @@
.In sys/timeout.h
.Ft void
.Fn timeout_set "struct timeout *to" "void (*fn)(void *)" "void *arg"
+.Ft void
+.Fn timeout_set_proc "struct timeout *to" "void (*fn)(void *)" "void *arg"
.Ft int
.Fn timeout_add "struct timeout *to" "int ticks"
.Ft int
@@ -85,9 +88,11 @@ times a second.
It is the responsibility of the caller to provide these functions with
pre-allocated timeout structures.
.Pp
-The function
+The functions
.Fn timeout_set
-prepares the timeout structure
+and
+.Fn timeout_set_proc
+prepare the timeout structure
.Fa to
to be used in future calls to
.Fn timeout_add
@@ -128,8 +133,12 @@ The timeout in the
.Fa to
argument must be already initialized by
.Fn timeout_set
+or
+.Fn timeout_set_proc
and may not be used in calls to
.Fn timeout_set
+or
+.Fn timeout_set_proc
until it has timed out or been removed with
.Fn timeout_del .
If the timeout in the
@@ -188,6 +197,8 @@ argument given in
.Fa arg .
.Sh CONTEXT
.Fn timeout_set
+and
+.Fn timeout_set_proc
can be called during autoconf, from process context, or from interrupt
context.
.Pp
@@ -211,8 +222,11 @@ When the timeout runs, the
.Fa fn
argument to
.Fn timeout_set
+or
+.Fn timeout_set_proc
will be called in an interrupt context at
-.Dv IPL_SOFTCLOCK .
+.Dv IPL_SOFTCLOCK
+or a process context, respectively.
.Sh RETURN VALUES
.Fn timeout_add ,
.Fn timeout_add_sec ,