summaryrefslogtreecommitdiffstats
path: root/share/man
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2007-03-21 22:22:13 +0000
committerjhb <jhb@FreeBSD.org>2007-03-21 22:22:13 +0000
commit29a0e4d380f757b23435fa91f828052c05d7fabe (patch)
treecab34dc7b313564085dcf4f17fc1d823447d693d /share/man
parentdee82f63223926cc8f13099524d77b36135890ea (diff)
downloadFreeBSD-src-29a0e4d380f757b23435fa91f828052c05d7fabe.zip
FreeBSD-src-29a0e4d380f757b23435fa91f828052c05d7fabe.tar.gz
Rename the cv_*wait*() functions to _cv_*wait*() and change their second
argument from a mutex to a lock_object. Add cv_*wait*() wrapper macros that accept either a mutex, rwlock, or sx lock as the second argument and convert it to a lock_object and then call _cv_*wait*(). Basically, the visible difference is that you can now use rwlocks and sx locks with condition variables using the same API as with mutexes.
Diffstat (limited to 'share/man')
-rw-r--r--share/man/man9/condvar.926
1 files changed, 17 insertions, 9 deletions
diff --git a/share/man/man9/condvar.9 b/share/man/man9/condvar.9
index 1976504..f54c73f 100644
--- a/share/man/man9/condvar.9
+++ b/share/man/man9/condvar.9
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 1, 2006
+.Dd March 21, 2007
.Dt CONDVAR 9
.Os
.Sh NAME
@@ -52,15 +52,15 @@
.Ft void
.Fn cv_destroy "struct cv *cvp"
.Ft void
-.Fn cv_wait "struct cv *cvp" "struct mtx *mp"
+.Fn cv_wait "struct cv *cvp" "lock"
.Ft int
-.Fn cv_wait_sig "struct cv *cvp" "struct mtx *mp"
+.Fn cv_wait_sig "struct cv *cvp" "lock"
.Ft void
-.Fn cv_wait_unlock "struct cv *cvp" "struct mtx *mp"
+.Fn cv_wait_unlock "struct cv *cvp" "lock"
.Ft int
-.Fn cv_timedwait "struct cv *cvp" "struct mtx *mp" "int timo"
+.Fn cv_timedwait "struct cv *cvp" "lock" "int timo"
.Ft int
-.Fn cv_timedwait_sig "struct cv *cvp" "struct mtx *mp" "int timo"
+.Fn cv_timedwait_sig "struct cv *cvp" "lock" "int timo"
.Ft void
.Fn cv_signal "struct cv *cvp"
.Ft void
@@ -109,8 +109,16 @@ returns the description string of
as set by the initial call to
.Fn cv_init .
.Pp
+The
+.Fa lock
+argument is a pointer to either a
+.Xr mutex 9 ,
+.Xr rwlock 9 ,
+or
+.Xr sx 9
+lock.
A thread must hold
-.Fa mp
+.Fa lock
before calling
.Fn cv_wait ,
.Fn cv_wait_sig ,
@@ -119,14 +127,14 @@ before calling
or
.Fn cv_timedwait_sig .
When a thread waits on a condition,
-.Fa mp
+.Fa lock
is atomically released before the thread is blocked, then reacquired
before the function call returns.
The
.Fn cv_wait_unlock
function does not reacquire the lock before returning.
All waiters must pass the same
-.Fa mp
+.Fa lock
in conjunction with
.Fa cvp .
.Pp
OpenPOWER on IntegriCloud