17b0d14f5SJoerg Wunsch.\" 27b0d14f5SJoerg Wunsch.\" Copyright (c) 1996 Joerg Wunsch 37b0d14f5SJoerg Wunsch.\" 47b0d14f5SJoerg Wunsch.\" All rights reserved. 57b0d14f5SJoerg Wunsch.\" 67b0d14f5SJoerg Wunsch.\" Redistribution and use in source and binary forms, with or without 77b0d14f5SJoerg Wunsch.\" modification, are permitted provided that the following conditions 87b0d14f5SJoerg Wunsch.\" are met: 97b0d14f5SJoerg Wunsch.\" 1. Redistributions of source code must retain the above copyright 107b0d14f5SJoerg Wunsch.\" notice, this list of conditions and the following disclaimer. 117b0d14f5SJoerg Wunsch.\" 2. Redistributions in binary form must reproduce the above copyright 127b0d14f5SJoerg Wunsch.\" notice, this list of conditions and the following disclaimer in the 137b0d14f5SJoerg Wunsch.\" documentation and/or other materials provided with the distribution. 147b0d14f5SJoerg Wunsch.\" 157b0d14f5SJoerg Wunsch.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR 167b0d14f5SJoerg Wunsch.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 177b0d14f5SJoerg Wunsch.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 187b0d14f5SJoerg Wunsch.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 197b0d14f5SJoerg Wunsch.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 207b0d14f5SJoerg Wunsch.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 217b0d14f5SJoerg Wunsch.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 227b0d14f5SJoerg Wunsch.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 237b0d14f5SJoerg Wunsch.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 247b0d14f5SJoerg Wunsch.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 257b0d14f5SJoerg Wunsch.\" 26f91aa773SAlexander Motin.Dd June 19, 2019 277b0d14f5SJoerg Wunsch.Dt SLEEP 9 28aa12cea2SUlrich Spörlein.Os 297b0d14f5SJoerg Wunsch.Sh NAME 30e66ccea4SJake Burkholder.Nm msleep , 31bf1fc2c2SDavide Italiano.Nm msleep_sbt , 3261d963bcSJohn Baldwin.Nm msleep_spin , 33bf1fc2c2SDavide Italiano.Nm msleep_spin_sbt , 3437e80fcaSJohn Baldwin.Nm pause , 35f0fb0d58SHans Petter Selasky.Nm pause_sig , 36bf1fc2c2SDavide Italiano.Nm pause_sbt , 37ac6a55a3SMike Pritchard.Nm tsleep , 38bf1fc2c2SDavide Italiano.Nm tsleep_sbt , 39f91aa773SAlexander Motin.Nm wakeup , 40f91aa773SAlexander Motin.Nm wakeup_one , 41f91aa773SAlexander Motin.Nm wakeup_any 427b0d14f5SJoerg Wunsch.Nd wait for events 437b0d14f5SJoerg Wunsch.Sh SYNOPSIS 4432eef9aeSRuslan Ermilov.In sys/param.h 4532eef9aeSRuslan Ermilov.In sys/systm.h 4632eef9aeSRuslan Ermilov.In sys/proc.h 477b0d14f5SJoerg Wunsch.Ft int 48fea73412SConrad Meyer.Fn msleep "const void *chan" "struct mtx *mtx" "int priority" "const char *wmesg" "int timo" 4961d963bcSJohn Baldwin.Ft int 50fea73412SConrad Meyer.Fn msleep_sbt "const void *chan" "struct mtx *mtx" "int priority" \ 51bf1fc2c2SDavide Italiano"const char *wmesg" "sbintime_t sbt" "sbintime_t pr" "int flags" 52bf1fc2c2SDavide Italiano.Ft int 53fea73412SConrad Meyer.Fn msleep_spin "const void *chan" "struct mtx *mtx" "const char *wmesg" "int timo" 54bf1fc2c2SDavide Italiano.Ft int 55fea73412SConrad Meyer.Fn msleep_spin_sbt "const void *chan" "struct mtx *mtx" "const char *wmesg" \ 56bf1fc2c2SDavide Italiano"sbintime_t sbt" "sbintime_t pr" "int flags" 57f0fb0d58SHans Petter Selasky.Ft int 5837e80fcaSJohn Baldwin.Fn pause "const char *wmesg" "int timo" 59f0fb0d58SHans Petter Selasky.Ft int 60f0fb0d58SHans Petter Selasky.Fn pause_sig "const char *wmesg" "int timo" 61f0fb0d58SHans Petter Selasky.Ft int 62bf1fc2c2SDavide Italiano.Fn pause_sbt "const char *wmesg" "sbintime_t sbt" "sbintime_t pr" \ 63bf1fc2c2SDavide Italiano "int flags" 6437e80fcaSJohn Baldwin.Ft int 65fea73412SConrad Meyer.Fn tsleep "const void *chan" "int priority" "const char *wmesg" "int timo" 66bf1fc2c2SDavide Italiano.Ft int 67fea73412SConrad Meyer.Fn tsleep_sbt "const void *chan" "int priority" "const char *wmesg" \ 68bf1fc2c2SDavide Italiano"sbintime_t sbt" "sbintime_t pr" "int flags" 6937e80fcaSJohn Baldwin.Ft void 70fea73412SConrad Meyer.Fn wakeup "const void *chan" 71db0ed862SMike Pritchard.Ft void 72fea73412SConrad Meyer.Fn wakeup_one "const void *chan" 73f91aa773SAlexander Motin.Ft void 74fea73412SConrad Meyer.Fn wakeup_any "const void *chan" 757b0d14f5SJoerg Wunsch.Sh DESCRIPTION 767b0d14f5SJoerg WunschThe functions 778ba7a357SJohn Baldwin.Fn tsleep , 788ba7a357SJohn Baldwin.Fn msleep , 798ba7a357SJohn Baldwin.Fn msleep_spin , 8037e80fcaSJohn Baldwin.Fn pause , 81f0fb0d58SHans Petter Selasky.Fn pause_sig , 82f0fb0d58SHans Petter Selasky.Fn pause_sbt , 838ba7a357SJohn Baldwin.Fn wakeup , 84f91aa773SAlexander Motin.Fn wakeup_one , 857b0d14f5SJoerg Wunschand 86f91aa773SAlexander Motin.Fn wakeup_any 878ba7a357SJohn Baldwinhandle event-based thread blocking. 888ba7a357SJohn BaldwinIf a thread must wait for an 898ba7a357SJohn Baldwinexternal event, it is put to sleep by 908ba7a357SJohn Baldwin.Fn tsleep , 918ba7a357SJohn Baldwin.Fn msleep , 9237e80fcaSJohn Baldwin.Fn msleep_spin , 93f0fb0d58SHans Petter Selasky.Fn pause , 94f0fb0d58SHans Petter Selasky.Fn pause_sig , 958ba7a357SJohn Baldwinor 96f0fb0d58SHans Petter Selasky.Fn pause_sbt . 97e7573e7aSJohn BaldwinThreads may also wait using one of the locking primitive sleep routines 98e7573e7aSJohn Baldwin.Xr mtx_sleep 9 , 99e7573e7aSJohn Baldwin.Xr rw_sleep 9 , 100e7573e7aSJohn Baldwinor 101e7573e7aSJohn Baldwin.Xr sx_sleep 9 . 102e7573e7aSJohn Baldwin.Pp 1037b0d14f5SJoerg WunschThe parameter 10461d963bcSJohn Baldwin.Fa chan 1057b0d14f5SJoerg Wunschis an arbitrary address that uniquely identifies the event on which 10637e80fcaSJohn Baldwinthe thread is being put to sleep. 1078ba7a357SJohn BaldwinAll threads sleeping on a single 10861d963bcSJohn Baldwin.Fa chan 1097b0d14f5SJoerg Wunschare woken up later by 110ace5be68SRuslan Ermilov.Fn wakeup , 1117b0d14f5SJoerg Wunschoften called from inside an interrupt routine, to indicate that the 1128ba7a357SJohn Baldwinresource the thread was blocking on is available now. 1137b0d14f5SJoerg Wunsch.Pp 1147b0d14f5SJoerg WunschThe parameter 1158ba7a357SJohn Baldwin.Fa priority 116e7573e7aSJohn Baldwinspecifies a new priority for the thread as well as some optional flags. 117e7573e7aSJohn BaldwinIf the new priority is not 0, 1188ba7a357SJohn Baldwinthen the thread will be made 1197b0d14f5SJoerg Wunschrunnable with the specified 1208ba7a357SJohn Baldwin.Fa priority 1218ba7a357SJohn Baldwinwhen it resumes. 122043b496bSWarner Losh.Dv PZERO 123043b496bSWarner Loshshould never be used, as it is for compatibility only. 124043b496bSWarner LoshA new priority of 0 means to use the thread's current priority when 125043b496bSWarner Loshit is made runnable again. 126ec897c88SKonstantin Belousov.Pp 1278ba7a357SJohn BaldwinIf 128ad1218e3SMaxim Konovalov.Fa priority 1297b0d14f5SJoerg Wunschincludes the 1309c2c5c6dSJoerg Wunsch.Dv PCATCH 1315e9723e2SBenjamin Kadukflag, pending signals are allowed to interrupt the sleep, otherwise 1325e9723e2SBenjamin Kadukpending signals are ignored during the sleep. 1337538a3c0STom RhodesIf 1349c2c5c6dSJoerg Wunsch.Dv PCATCH 1355e9723e2SBenjamin Kadukis set and a signal becomes pending, 136b92a189eSRuslan Ermilov.Er ERESTART 1377b0d14f5SJoerg Wunschis returned if the current system call should be restarted if 1387b0d14f5SJoerg Wunschpossible, and 139b92a189eSRuslan Ermilov.Er EINTR 1407b0d14f5SJoerg Wunschis returned if the system call should be interrupted by the signal 141c4d9468eSRuslan Ermilov(return 142c4d9468eSRuslan Ermilov.Er EINTR ) . 1437b0d14f5SJoerg Wunsch.Pp 144e7573e7aSJohn BaldwinThe parameter 145e7573e7aSJohn Baldwin.Fa wmesg 146e7573e7aSJohn Baldwinis a string describing the sleep condition for tools like 147e7573e7aSJohn Baldwin.Xr ps 1 . 148e7573e7aSJohn BaldwinDue to the limited space of those programs to display arbitrary strings, 149e7573e7aSJohn Baldwinthis message should not be longer than 6 characters. 150e7573e7aSJohn Baldwin.Pp 151e7573e7aSJohn BaldwinThe parameter 152e7573e7aSJohn Baldwin.Fa timo 153e7573e7aSJohn Baldwinspecifies a timeout for the sleep. 154e7573e7aSJohn BaldwinIf 155e7573e7aSJohn Baldwin.Fa timo 156e7573e7aSJohn Baldwinis not 0, 157e7573e7aSJohn Baldwinthen the thread will sleep for at most 158e7573e7aSJohn Baldwin.Fa timo No / Va hz 159e7573e7aSJohn Baldwinseconds. 160e7573e7aSJohn BaldwinIf the timeout expires, 161e7573e7aSJohn Baldwinthen the sleep function will return 162e7573e7aSJohn Baldwin.Er EWOULDBLOCK . 163e7573e7aSJohn Baldwin.Pp 164bf1fc2c2SDavide Italiano.Fn msleep_sbt , 165bf1fc2c2SDavide Italiano.Fn msleep_spin_sbt , 166bf1fc2c2SDavide Italiano.Fn pause_sbt 167bf1fc2c2SDavide Italianoand 168bf1fc2c2SDavide Italiano.Fn tsleep_sbt 169bf1fc2c2SDavide Italianofunctions take 170bf1fc2c2SDavide Italiano.Fa sbt 171bf1fc2c2SDavide Italianoparameter instead of 172bf1fc2c2SDavide Italiano.Fa timo . 173193ecaecSMatt JacobIt allows the caller to specify relative or absolute wakeup time with higher resolution 174bf1fc2c2SDavide Italianoin form of 175bf1fc2c2SDavide Italiano.Vt sbintime_t . 176bf1fc2c2SDavide ItalianoThe parameter 177bf1fc2c2SDavide Italiano.Fa pr 178193ecaecSMatt Jacoballows the caller to specify wanted absolute event precision. 179bf1fc2c2SDavide ItalianoThe parameter 180bf1fc2c2SDavide Italiano.Fa flags 181193ecaecSMatt Jacoballows the caller to pass additional 182bf1fc2c2SDavide Italiano.Fn callout_reset_sbt 183bf1fc2c2SDavide Italianoflags. 184bf1fc2c2SDavide Italiano.Pp 185e7573e7aSJohn BaldwinSeveral of the sleep functions including 186e7573e7aSJohn Baldwin.Fn msleep , 187e7573e7aSJohn Baldwin.Fn msleep_spin , 188e7573e7aSJohn Baldwinand the locking primitive sleep routines specify an additional lock 1898ba7a357SJohn Baldwinparameter. 190e7573e7aSJohn BaldwinThe lock will be released before sleeping and reacquired 191e7573e7aSJohn Baldwinbefore the sleep routine returns. 192e7573e7aSJohn BaldwinIf 193e7573e7aSJohn Baldwin.Fa priority 194e7573e7aSJohn Baldwinincludes the 195e7573e7aSJohn Baldwin.Dv PDROP 196e7573e7aSJohn Baldwinflag, then 197e7573e7aSJohn Baldwinthe lock will not be reacquired before returning. 198e7573e7aSJohn BaldwinThe lock is used to ensure that a condition can be checked atomically, 199e7573e7aSJohn Baldwinand that the current thread can be suspended without missing a 200e7573e7aSJohn Baldwinchange to the condition, or an associated wakeup. 201e7573e7aSJohn BaldwinIn addition, all of the sleep routines will fully drop the 202e7573e7aSJohn Baldwin.Va Giant 203e7573e7aSJohn Baldwinmutex 204e7573e7aSJohn Baldwin(even if recursed) 205e7573e7aSJohn Baldwinwhile the thread is suspended and will reacquire the 206e7573e7aSJohn Baldwin.Va Giant 207e7573e7aSJohn Baldwinmutex before the function returns. 208414e7679SJohn BaldwinNote that the 209414e7679SJohn Baldwin.Va Giant 210414e7679SJohn Baldwinmutex may be specified as the lock to drop. 211414e7679SJohn BaldwinIn that case, however, the 212414e7679SJohn Baldwin.Dv PDROP 213414e7679SJohn Baldwinflag is not allowed. 214e7573e7aSJohn Baldwin.Pp 215e7573e7aSJohn BaldwinTo avoid lost wakeups, 216e7573e7aSJohn Baldwineither a lock should be used to protect against races, 217e7573e7aSJohn Baldwinor a timeout should be specified to place an upper bound on the delay due 218e7573e7aSJohn Baldwinto a lost wakeup. 219e7573e7aSJohn BaldwinAs a result, 220e7573e7aSJohn Baldwinthe 221e7573e7aSJohn Baldwin.Fn tsleep 222e7573e7aSJohn Baldwinfunction should only be invoked with a timeout of 0 when the 223e7573e7aSJohn Baldwin.Va Giant 224e7573e7aSJohn Baldwinmutex is held. 225e7573e7aSJohn Baldwin.Pp 226e7573e7aSJohn BaldwinThe 227e7573e7aSJohn Baldwin.Fn msleep 228e7573e7aSJohn Baldwinfunction requires that 229e7573e7aSJohn Baldwin.Fa mtx 230e7573e7aSJohn Baldwinreference a default, i.e. non-spin, mutex. 2316238e679SGreg LeheyIts use is deprecated in favor of 232e7573e7aSJohn Baldwin.Xr mtx_sleep 9 233e7573e7aSJohn Baldwinwhich provides identical behavior. 23461d963bcSJohn Baldwin.Pp 23561d963bcSJohn BaldwinThe 23661d963bcSJohn Baldwin.Fn msleep_spin 237e7573e7aSJohn Baldwinfunction requires that 23861d963bcSJohn Baldwin.Fa mtx 239e7573e7aSJohn Baldwinreference a spin mutex. 240e7573e7aSJohn BaldwinThe 241e7573e7aSJohn Baldwin.Fn msleep_spin 242e7573e7aSJohn Baldwinfunction does not accept a 24361d963bcSJohn Baldwin.Fa priority 244e7573e7aSJohn Baldwinparameter and thus does not support changing the current thread's priority, 245e7573e7aSJohn Baldwinthe 24661d963bcSJohn Baldwin.Dv PDROP 247e7573e7aSJohn Baldwinflag, 248e7573e7aSJohn Baldwinor catching signals via the 24961d963bcSJohn Baldwin.Dv PCATCH 250e7573e7aSJohn Baldwinflag. 25137e80fcaSJohn Baldwin.Pp 25237e80fcaSJohn BaldwinThe 25337e80fcaSJohn Baldwin.Fn pause 25437e80fcaSJohn Baldwinfunction is a wrapper around 25537e80fcaSJohn Baldwin.Fn tsleep 25637e80fcaSJohn Baldwinthat suspends execution of the current thread for the indicated timeout. 25737e80fcaSJohn BaldwinThe thread can not be awakened early by signals or calls to 258f91aa773SAlexander Motin.Fn wakeup , 259f91aa773SAlexander Motin.Fn wakeup_one 26037e80fcaSJohn Baldwinor 261f91aa773SAlexander Motin.Fn wakeup_any . 262f0fb0d58SHans Petter SelaskyThe 263f0fb0d58SHans Petter Selasky.Fn pause_sig 264f0fb0d58SHans Petter Selaskyfunction is a variant of 265f0fb0d58SHans Petter Selasky.Fn pause 266f0fb0d58SHans Petter Selaskywhich can be awakened early by signals. 267759ace7eSGreg Lehey.Pp 268759ace7eSGreg LeheyThe 269759ace7eSGreg Lehey.Fn wakeup_one 270f91aa773SAlexander Motinfunction makes the first highest priority thread in the queue that is 271f91aa773SAlexander Motinsleeping on the parameter 272759ace7eSGreg Lehey.Fa chan 273759ace7eSGreg Leheyrunnable. 274759ace7eSGreg LeheyThis reduces the load when a large number of threads are sleeping on 275759ace7eSGreg Leheythe same address, but only one of them can actually do any useful work 276759ace7eSGreg Leheywhen made runnable. 277759ace7eSGreg Lehey.Pp 278759ace7eSGreg LeheyDue to the way it works, the 279759ace7eSGreg Lehey.Fn wakeup_one 280759ace7eSGreg Leheyfunction requires that only related threads sleep on a specific 281759ace7eSGreg Lehey.Fa chan 282759ace7eSGreg Leheyaddress. 283759ace7eSGreg LeheyIt is the programmer's responsibility to choose a unique 284759ace7eSGreg Lehey.Fa chan 285759ace7eSGreg Leheyvalue. 286759ace7eSGreg LeheyThe older 287759ace7eSGreg Lehey.Fn wakeup 2881c5fcea1SGreg Leheyfunction did not require this, though it was never good practice 289c907770cSGreg Leheyfor threads to share a 290759ace7eSGreg Lehey.Fa chan 291759ace7eSGreg Leheyvalue. 292759ace7eSGreg LeheyWhen converting from 293759ace7eSGreg Lehey.Fn wakeup 294759ace7eSGreg Leheyto 295759ace7eSGreg Lehey.Fn wakeup_one , 296c907770cSGreg Leheypay particular attention to ensure that no other threads wait on the 297c907770cSGreg Leheysame 298759ace7eSGreg Lehey.Fa chan . 2998addc72bSEric van Gyzen.Pp 300f91aa773SAlexander MotinThe 301f91aa773SAlexander Motin.Fn wakeup_any 302f91aa773SAlexander Motinfunction is similar to 303f91aa773SAlexander Motin.Fn wakeup_one , 304f91aa773SAlexander Motinexcept that it makes runnable last thread on the queue (sleeping less), 305f91aa773SAlexander Motinignoring fairness. 306f91aa773SAlexander MotinIt can be used when threads sleeping on the 307f91aa773SAlexander Motin.Fa chan 308f91aa773SAlexander Motinare known to be identical and there is no reason to be fair. 309f91aa773SAlexander Motin.Pp 3108addc72bSEric van GyzenIf the timeout given by 3118addc72bSEric van Gyzen.Fa timo 3128addc72bSEric van Gyzenor 3138addc72bSEric van Gyzen.Fa sbt 3148addc72bSEric van Gyzenis based on an absolute real-time clock value, 3158addc72bSEric van Gyzenthen the thread should copy the global 3168addc72bSEric van Gyzen.Va rtc_generation 3178addc72bSEric van Gyzeninto its 3188addc72bSEric van Gyzen.Va td_rtcgen 3198addc72bSEric van Gyzenmember before reading the RTC. 3208addc72bSEric van GyzenIf the real-time clock is adjusted, these functions will set 3218addc72bSEric van Gyzen.Va td_rtcgen 3228addc72bSEric van Gyzento zero and return zero. 3238addc72bSEric van GyzenThe caller should reconsider its orientation with the new RTC value. 3247b0d14f5SJoerg Wunsch.Sh RETURN VALUES 3252634879bSJohn-Mark GurneyWhen awakened by a call to 3262634879bSJohn-Mark Gurney.Fn wakeup 3272634879bSJohn-Mark Gurneyor 3282634879bSJohn-Mark Gurney.Fn wakeup_one , 3292634879bSJohn-Mark Gurneyif a signal is pending and 3302634879bSJohn-Mark Gurney.Dv PCATCH 3312634879bSJohn-Mark Gurneyis specified, 3322634879bSJohn-Mark Gurneya non-zero error code is returned. 333e7573e7aSJohn BaldwinIf the thread is awakened by a call to 334e7573e7aSJohn Baldwin.Fn wakeup 335e7573e7aSJohn Baldwinor 336e7573e7aSJohn Baldwin.Fn wakeup_one , 337e7573e7aSJohn Baldwinthe 338e7573e7aSJohn Baldwin.Fn msleep , 339e7573e7aSJohn Baldwin.Fn msleep_spin , 340e7573e7aSJohn Baldwin.Fn tsleep , 341e7573e7aSJohn Baldwinand locking primitive sleep functions return 0. 3428addc72bSEric van GyzenZero can also be returned when the real-time clock is adjusted; 3438addc72bSEric van Gyzensee above regarding 3448addc72bSEric van Gyzen.Va td_rtcgen . 345e7573e7aSJohn BaldwinOtherwise, a non-zero error code is returned. 346e7573e7aSJohn Baldwin.Sh ERRORS 347e7573e7aSJohn Baldwin.Fn msleep , 348e7573e7aSJohn Baldwin.Fn msleep_spin , 349e7573e7aSJohn Baldwin.Fn tsleep , 350e7573e7aSJohn Baldwinand the locking primitive sleep functions will fail if: 351e7573e7aSJohn Baldwin.Bl -tag -width Er 352e7573e7aSJohn Baldwin.It Bq Er EINTR 353e7573e7aSJohn BaldwinThe 354e7573e7aSJohn Baldwin.Dv PCATCH 355e7573e7aSJohn Baldwinflag was specified, a signal was caught, and the system call should be 356e7573e7aSJohn Baldwininterrupted. 357e7573e7aSJohn Baldwin.It Bq Er ERESTART 358e7573e7aSJohn BaldwinThe 359e7573e7aSJohn Baldwin.Dv PCATCH 360e7573e7aSJohn Baldwinflag was specified, a signal was caught, and the system call should be 361e7573e7aSJohn Baldwinrestarted. 362e7573e7aSJohn Baldwin.It Bq Er EWOULDBLOCK 363e7573e7aSJohn BaldwinA non-zero timeout was specified and the timeout expired. 364e7573e7aSJohn Baldwin.El 3657b0d14f5SJoerg Wunsch.Sh SEE ALSO 3661ddb2070SMatthew Dillon.Xr ps 1 , 367*8965b303SMitchell Horne.Xr callout 9 , 368a280550aSJulian Elischer.Xr locking 9 , 3694fea914dSMark Murray.Xr malloc 9 , 370e7573e7aSJohn Baldwin.Xr mi_switch 9 , 371e7573e7aSJohn Baldwin.Xr mtx_sleep 9 , 372e7573e7aSJohn Baldwin.Xr rw_sleep 9 , 373*8965b303SMitchell Horne.Xr sx_sleep 9 3747b0d14f5SJoerg Wunsch.Sh HISTORY 375fc5fe41fSGreg LeheyThe functions 376fc5fe41fSGreg Lehey.Fn sleep 377fc5fe41fSGreg Leheyand 378fc5fe41fSGreg Lehey.Fn wakeup 3797700fc3cSRuslan Ermilovwere present in 380fc5fe41fSGreg Lehey.At v1 . 381fc5fe41fSGreg LeheyThey were probably also present in the preceding 3827700fc3cSRuslan ErmilovPDP-7 version of 3837700fc3cSRuslan Ermilov.Ux . 384fc5fe41fSGreg LeheyThey were the basic process synchronization model. 3857b0d14f5SJoerg Wunsch.Pp 386cd9f822bSTom RhodesThe 387ace5be68SRuslan Ermilov.Fn tsleep 388cd9f822bSTom Rhodesfunction appeared in 389fc5fe41fSGreg Lehey.Bx 4.4 390fc5fe41fSGreg Leheyand added the parameters 391fc5fe41fSGreg Lehey.Fa wmesg 392fc5fe41fSGreg Leheyand 393fc5fe41fSGreg Lehey.Fa timo . 39461d963bcSJohn BaldwinThe 39588661745SGreg Lehey.Fn sleep 39688661745SGreg Leheyfunction was removed in 39788661745SGreg Lehey.Fx 2.2 . 39888661745SGreg LeheyThe 3998ba7a357SJohn Baldwin.Fn wakeup_one 4008ba7a357SJohn Baldwinfunction appeared in 4018ba7a357SJohn Baldwin.Fx 2.2 . 4028ba7a357SJohn BaldwinThe 40361d963bcSJohn Baldwin.Fn msleep 40461d963bcSJohn Baldwinfunction appeared in 40561d963bcSJohn Baldwin.Fx 5.0 , 40661d963bcSJohn Baldwinand the 40761d963bcSJohn Baldwin.Fn msleep_spin 40861d963bcSJohn Baldwinfunction appeared in 40937e80fcaSJohn Baldwin.Fx 6.2 . 4107700fc3cSRuslan ErmilovThe 41137e80fcaSJohn Baldwin.Fn pause 41237e80fcaSJohn Baldwinfunction appeared in 41361d963bcSJohn Baldwin.Fx 7.0 . 414f0fb0d58SHans Petter SelaskyThe 415f0fb0d58SHans Petter Selasky.Fn pause_sig 416f0fb0d58SHans Petter Selaskyfunction appeared in 417f0fb0d58SHans Petter Selasky.Fx 12.0 . 4187b0d14f5SJoerg Wunsch.Sh AUTHORS 419f4d874a1SRuslan Ermilov.An -nosplit 420571dba6eSHiten PandyaThis manual page was written by 4218a7314fcSBaptiste Daroussin.An J\(:org Wunsch Aq Mt joerg@FreeBSD.org . 422