| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: _lwp_park.2,v 1.11 2017/12/08 09:14:36 wiz Exp $ | | 1 | .\" $NetBSD: _lwp_park.2,v 1.12 2019/07/31 23:53:25 pgoyette Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2003, 2007, 2017 The NetBSD Foundation, Inc. | | 3 | .\" Copyright (c) 2003, 2007, 2017 The NetBSD Foundation, Inc. |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | | 6 | .\" This code is derived from software contributed to The NetBSD Foundation |
7 | .\" by Jason R. Thorpe of Wasabi Systems, Inc, and by Andrew Doran. | | 7 | .\" by Jason R. Thorpe of Wasabi Systems, Inc, and by Andrew Doran. |
8 | .\" | | 8 | .\" |
9 | .\" Redistribution and use in source and binary forms, with or without | | 9 | .\" Redistribution and use in source and binary forms, with or without |
10 | .\" modification, are permitted provided that the following conditions | | 10 | .\" modification, are permitted provided that the following conditions |
11 | .\" are met: | | 11 | .\" are met: |
12 | .\" 1. Redistributions of source code must retain the above copyright | | 12 | .\" 1. Redistributions of source code must retain the above copyright |
13 | .\" notice, this list of conditions and the following disclaimer. | | 13 | .\" notice, this list of conditions and the following disclaimer. |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| @@ -17,54 +17,54 @@ | | | @@ -17,54 +17,54 @@ |
17 | .\" | | 17 | .\" |
18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
28 | .\" POSSIBILITY OF SUCH DAMAGE. | | 28 | .\" POSSIBILITY OF SUCH DAMAGE. |
29 | .\" | | 29 | .\" |
30 | .Dd December 7, 2017 | | 30 | .Dd July 30, 2019 |
31 | .Dt _LWP_PARK 2 | | 31 | .Dt _LWP_PARK 2 |
32 | .Os | | 32 | .Os |
33 | .Sh NAME | | 33 | .Sh NAME |
34 | .Nm _lwp_park | | 34 | .Nm _lwp_park |
35 | .Nd wait interruptably in the kernel | | 35 | .Nd wait interruptably in the kernel |
36 | .Sh LIBRARY | | 36 | .Sh LIBRARY |
37 | .Lb libc | | 37 | .Lb libc |
38 | .Sh SYNOPSIS | | 38 | .Sh SYNOPSIS |
39 | .In lwp.h | | 39 | .In lwp.h |
40 | .Ft int | | 40 | .Ft int |
41 | .Fn _lwp_park "clockid_t clock_id" "int flags" "struct timespec *ts" "lwpid_t unpark" "const void *hint" "const void *unparkhint" | | 41 | .Fn _lwp_park "clockid_t clock_id" "int flags" "struct timespec *ts" "lwpid_t unpark" "const void *hint" "const void *unparkhint" |
42 | .Sh DESCRIPTION | | 42 | .Sh DESCRIPTION |
43 | .Fn _lwp_park | | 43 | .Fn _lwp_park |
44 | can be used to synchronize access to resources among multiple light-weight | | 44 | can be used to synchronize access to resources among multiple light-weight |
45 | processes. | | 45 | processes. |
46 | It causes the calling LWP to wait interruptably in the kernel, until one | | 46 | It causes the calling LWP to wait interruptably in the kernel, until one |
47 | of the following conditions is met: | | 47 | of the following conditions is met: |
48 | .Bl -bullet | | 48 | .Bl -bullet |
49 | .It | | 49 | .It |
50 | The | | 50 | The |
51 | .Fa ts | | 51 | .Fa ts |
52 | argument is | | 52 | argument is |
53 | .Pf non- Dv NULL , | | 53 | .Pf non- Dv NULL , |
54 | and the time it specifies has passed. | | 54 | and the time it specifies has passed. |
55 | The | | 55 | The |
56 | .Fa ts | | 56 | .Fa ts |
57 | time can be an relative interval to wait if the | | 57 | time can be a relative interval to wait if the |
58 | .Ar flags | | 58 | .Ar flags |
59 | argument does not contain | | 59 | argument does not contain |
60 | .Dv TIMER_ABSTIME | | 60 | .Dv TIMER_ABSTIME |
61 | or it can be an absolute time. | | 61 | or it can be an absolute time. |
62 | The | | 62 | The |
63 | .Fa clock_id | | 63 | .Fa clock_id |
64 | argument contains the clock to be used; it can be: | | 64 | argument contains the clock to be used; it can be: |
65 | .Dv CLOCK_REALTIME | | 65 | .Dv CLOCK_REALTIME |
66 | or | | 66 | or |
67 | .Dv CLOCK_MONOTONIC . | | 67 | .Dv CLOCK_MONOTONIC . |
68 | .It | | 68 | .It |
69 | The LWP receives a directed signal posted using | | 69 | The LWP receives a directed signal posted using |
70 | .Fn _lwp_kill , | | 70 | .Fn _lwp_kill , |
| @@ -92,27 +92,27 @@ The preferred method to awaken an LWP sl | | | @@ -92,27 +92,27 @@ The preferred method to awaken an LWP sl |
92 | to | | 92 | to |
93 | .Fn _lwp_park | | 93 | .Fn _lwp_park |
94 | is to make a call to | | 94 | is to make a call to |
95 | .Fn _lwp_unpark , | | 95 | .Fn _lwp_unpark , |
96 | or | | 96 | or |
97 | .Fn _lwp_unpark_all . | | 97 | .Fn _lwp_unpark_all . |
98 | The | | 98 | The |
99 | .Fn _lwp_wakeup | | 99 | .Fn _lwp_wakeup |
100 | system call is a more general facility, and requires more resources | | 100 | system call is a more general facility, and requires more resources |
101 | to execute. | | 101 | to execute. |
102 | .Pp | | 102 | .Pp |
103 | The optional | | 103 | The optional |
104 | .Fa hint | | 104 | .Fa hint |
105 | argument specifies the address of object upon which the LWP is | | 105 | argument specifies the address of an object upon which the LWP is |
106 | synchronizing. | | 106 | synchronizing. |
107 | When the | | 107 | When the |
108 | .Fa hint | | 108 | .Fa hint |
109 | value is matched between calls to | | 109 | value is matched between calls to |
110 | .Fn _lwp_park | | 110 | .Fn _lwp_park |
111 | and | | 111 | and |
112 | .Fn _lwp_unpark | | 112 | .Fn _lwp_unpark |
113 | or | | 113 | or |
114 | .Fn _lwp_unpark_all , | | 114 | .Fn _lwp_unpark_all , |
115 | it may reduce the time necessary for the system to resume execution | | 115 | it may reduce the time necessary for the system to resume execution |
116 | of waiting LWPs. | | 116 | of waiting LWPs. |
117 | .Pp | | 117 | .Pp |
118 | The | | 118 | The |