From d9372eab7242eadfd4a3d7c24ca5a0a2046daed7 Mon Sep 17 00:00:00 2001 From: jake Date: Mon, 11 Sep 2000 00:52:31 +0000 Subject: Add scant documentation for msleep. --- share/man/man9/Makefile | 2 +- share/man/man9/sleep.9 | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 9a1ceef..968cae9 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -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 diff --git a/share/man/man9/sleep.9 b/share/man/man9/sleep.9 index 2079cd3..f371652 100644 --- a/share/man/man9/sleep.9 +++ b/share/man/man9/sleep.9 @@ -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 -- cgit v1.1