Add scant documentation for msleep.

This commit is contained in:
Jake Burkholder 2000-09-11 00:52:31 +00:00
parent 817bf5d4a6
commit e66ccea4a1
2 changed files with 20 additions and 1 deletions

View File

@ -73,7 +73,7 @@ MLINKS+=posix4.9 p1003_1b.9
MLINKS+=psignal.9 gsignal.9 psignal.9 pgsignal.9
MLINKS+=rtalloc.9 rtalloc1.9 rtalloc.9 rtalloc_ign.9
MLINKS+=sleep.9 tsleep.9 sleep.9 wakeup.9 sleep.9 wakeup_one.9
MLINKS+=sleep.9 asleep.9 sleep.9 await.9
MLINKS+=sleep.9 asleep.9 sleep.9 await.9 sleep.9 msleep.9
MLINKS+=buf.9 bp.9
MLINKS+=spl.9 spl0.9
MLINKS+=spl.9 splbio.9 spl.9 splclock.9 spl.9 splhigh.9 spl.9 splimp.9

View File

@ -30,6 +30,7 @@
.Dt SLEEP 9
.Sh NAME
.Nm sleep ,
.Nm msleep ,
.Nm tsleep ,
.Nm asleep ,
.Nm await ,
@ -42,6 +43,8 @@
.Ft int
.Fn tsleep "void *ident" "int priority" "const char *wmesg" "int timo"
.Ft int
.Fn msleep "void *ident" "mtx_t *mtx" "int priority" "const char *wmesg" "int timo"
.Ft int
.Fn asleep "void *ident" "int priority" "const char *wmesg" "int timo"
.Ft int
.Fn await "int priority" "int timo"
@ -108,6 +111,22 @@ possible, and
is returned if the system call should be interrupted by the signal
.Pq return Dv EINTR .
.Pp
.Nm Msleep
is a variation on tsleep. The parameter
.Ar mtx
is a mutex, which will be exited before sleeping, and entered before
.Nm msleep
returns. If
.Ar pri
includes the
.Dv PDROP
flag, the
.Ar mtx
parameter will not be entered before returning. The mutex is
used to ensure that a condition can be checked atomicly, and
that the current process can be suspended without missing a
change to the condition, or an associated wakeup.
.Pp
.Nm Asleep
implements the new asynchronous sleep function. It takes the same arguments
as