diff options
author | jhb <jhb@FreeBSD.org> | 2007-02-23 16:22:09 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2007-02-23 16:22:09 +0000 |
commit | 401f7aaf8a4b36c5409b47caeb111224c19cfa64 (patch) | |
tree | c39c70c56ffcacc39b3ae90078a8abf26cbf23c3 /share/man/man9/sleep.9 | |
parent | 0e74f15f22d8628da5552eae28cccc969b056e13 (diff) | |
download | FreeBSD-src-401f7aaf8a4b36c5409b47caeb111224c19cfa64.zip FreeBSD-src-401f7aaf8a4b36c5409b47caeb111224c19cfa64.tar.gz |
Add a new kernel sleep function pause(9). pause(9) is for places that
want an equivalent of DELAY(9) that sleeps instead of spins. It accepts
a wmesg and a timeout and is not interrupted by signals. It uses a private
wait channel that should never be woken up by wakeup(9) or wakeup_one(9).
Glanced at by: phk
Diffstat (limited to 'share/man/man9/sleep.9')
-rw-r--r-- | share/man/man9/sleep.9 | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/share/man/man9/sleep.9 b/share/man/man9/sleep.9 index db97565..0973fc5 100644 --- a/share/man/man9/sleep.9 +++ b/share/man/man9/sleep.9 @@ -31,6 +31,7 @@ .Sh NAME .Nm msleep , .Nm msleep_spin , +.Nm pause , .Nm tsleep , .Nm wakeup .Nd wait for events @@ -39,12 +40,14 @@ .In sys/systm.h .In sys/proc.h .Ft int -.Fn tsleep "void *chan" "int priority" "const char *wmesg" "int timo" -.Ft int .Fn msleep "void *chan" "struct mtx *mtx" "int priority" "const char *wmesg" "int timo" .Ft int .Fn msleep_spin "void *chan" "struct mtx *mtx" "const char *wmesg" "int timo" .Ft void +.Fn pause "const char *wmesg" "int timo" +.Ft int +.Fn tsleep "void *chan" "int priority" "const char *wmesg" "int timo" +.Ft void .Fn wakeup "void *chan" .Ft void .Fn wakeup_one "void *chan" @@ -53,6 +56,7 @@ The functions .Fn tsleep , .Fn msleep , .Fn msleep_spin , +.Fn pause , .Fn wakeup , and .Fn wakeup_one @@ -61,12 +65,13 @@ If a thread must wait for an external event, it is put to sleep by .Fn tsleep , .Fn msleep , +.Fn msleep_spin , or -.Fn msleep_spin . +.Fn pause . The parameter .Fa chan is an arbitrary address that uniquely identifies the event on which -the thread is being asleep. +the thread is being put to sleep. All threads sleeping on a single .Fa chan are woken up later by @@ -184,6 +189,16 @@ and it does not support the and .Dv PCATCH flags. +.Pp +The +.Fn pause +function is a wrapper around +.Fn tsleep +that suspends execution of the current thread for the indicated timeout. +The thread can not be awakened early by signals or calls to +.Fn wakeup +or +.Fn wakeup_one. .Sh RETURN VALUES See above. .Sh SEE ALSO @@ -211,6 +226,10 @@ function appeared in and the .Fn msleep_spin function appeared in +.Fx 6.2 . +.The +.Fn pause +function appeared in .Fx 7.0 . .Pp The |