diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2014-12-22 04:43:39 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2014-12-22 04:43:39 +0000 |
commit | 3a9e25fc873862839dd24b57eee62cd9ff21eb19 (patch) | |
tree | 946cebc89fc85516db7cde671fb9d3ad2c2fed34 /share | |
parent | 4c3e2b03181a91c59b536d4cdec6f6f5d1cdf236 (diff) |
add TIMEOUT_INITIALIZER for initting timeout declaractions.
similar to TASK_INITIALIZER and all the queue _INITIALIZER things.
ok deraadt@
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man9/Makefile | 5 | ||||
-rw-r--r-- | share/man/man9/timeout.9 | 18 |
2 files changed, 18 insertions, 5 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 44f0fd4893b..558cea2684a 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.225 2014/12/11 14:29:42 jmc Exp $ +# $OpenBSD: Makefile,v 1.226 2014/12/22 04:43:38 dlg Exp $ # $NetBSD: Makefile,v 1.4 1996/01/09 03:23:01 thorpej Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -385,7 +385,8 @@ MLINKS+=timeout.9 timeout_add.9 timeout.9 timeout_set.9 \ timeout.9 timeout_add_sec.9 \ timeout.9 timeout_add_msec.9 \ timeout.9 timeout_add_usec.9 \ - timeout.9 timeout_add_nsec.9 + timeout.9 timeout_add_nsec.9 \ + timeout.9 TIMEOUT_INITIALIZER.9 MLINKS+=tsleep.9 wakeup.9 tsleep.9 wakeup_n.9 tsleep.9 wakeup_one.9 \ tsleep.9 msleep.9 MLINKS+=tvtohz.9 tstohz.9 diff --git a/share/man/man9/timeout.9 b/share/man/man9/timeout.9 index b0c8aef7de4..9034622336f 100644 --- a/share/man/man9/timeout.9 +++ b/share/man/man9/timeout.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: timeout.9,v 1.37 2014/02/13 14:20:07 jmc Exp $ +.\" $OpenBSD: timeout.9,v 1.38 2014/12/22 04:43:38 dlg Exp $ .\" .\" Copyright (c) 2000 Artur Grabowski <art@openbsd.org> .\" All rights reserved. @@ -23,7 +23,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: February 13 2014 $ +.Dd $Mdocdate: December 22 2014 $ .Dt TIMEOUT 9 .Os .Sh NAME @@ -39,7 +39,8 @@ .Nm timeout_del , .Nm timeout_pending , .Nm timeout_initialized , -.Nm timeout_triggered +.Nm timeout_triggered , +.Nm TIMEOUT_INITIALIZER .Nd execute a function after a specified period of time .Sh SYNOPSIS .In sys/types.h @@ -70,6 +71,7 @@ .Fn "timeout_add_usec" "struct timeout *to" "int usec" .Ft int .Fn "timeout_add_nsec" "struct timeout *to" "int nsec" +.Fn "TIMEOUT_INITIALIZER" "void (*fn)(void *)" "void *arg" .Sh DESCRIPTION The .Nm timeout @@ -173,6 +175,16 @@ functions instead of .Fn timeout_add . Those functions add a timeout whilst converting the time specified by the respective types. +.Pp +A timeout declaration can be initialised with the +.Fn TIMEOUT_INITIALIZER +macro. +The timeout will be prepared to call the function specified by the +.Fa fn +argument with the +.Fa void * +argument given in +.Fa arg . .Sh CONTEXT .Fn timeout_set can be called during autoconf, from process context, or from interrupt |