summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2007-03-09 16:59:27 +0000
committerjhb <jhb@FreeBSD.org>2007-03-09 16:59:27 +0000
commit0090f876632dab1384a595e9bb4d6b2cca1ef035 (patch)
treea3d010bc8d1234efba13a07d5cf7c37d2a6ae1d1 /share
parentbf4e259df634b3fb790a6bcc5a12b27f692b0436 (diff)
downloadFreeBSD-src-0090f876632dab1384a595e9bb4d6b2cca1ef035.zip
FreeBSD-src-0090f876632dab1384a595e9bb4d6b2cca1ef035.tar.gz
- Document cv_wait_unlock(9).
- Don't claim that the mutex is atomically reacquired when a cv_wait routine returns. There's nothing atomic or magical about the lock reacquire. The only magic is that we atomically drop the lock by placing the thread on the sleep queue before dropping the lock.
Diffstat (limited to 'share')
-rw-r--r--share/man/man9/Makefile1
-rw-r--r--share/man/man9/condvar.911
2 files changed, 11 insertions, 1 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index af7bac2..64793de 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -505,6 +505,7 @@ MLINKS+=condvar.9 cv_broadcast.9 \
condvar.9 cv_timedwait_sig.9 \
condvar.9 cv_wait.9 \
condvar.9 cv_wait_sig.9 \
+ condvar.9 cv_wait_unlock.9 \
condvar.9 cv_wmesg.9
MLINKS+=config_intrhook.9 config_intrhook_disestablish.9 \
config_intrhook.9 config_intrhook_establish.9
diff --git a/share/man/man9/condvar.9 b/share/man/man9/condvar.9
index 1a8730e..97d3134 100644
--- a/share/man/man9/condvar.9
+++ b/share/man/man9/condvar.9
@@ -35,6 +35,7 @@
.Nm cv_destroy ,
.Nm cv_wait ,
.Nm cv_wait_sig ,
+.Nm cv_wait_unlock ,
.Nm cv_timedwait ,
.Nm cv_timedwait_sig ,
.Nm cv_signal ,
@@ -54,6 +55,8 @@
.Fn cv_wait "struct cv *cvp" "struct mtx *mp"
.Ft int
.Fn cv_wait_sig "struct cv *cvp" "struct mtx *mp"
+.Ft void
+.Fn cv_wait_unlock "struct cv *cvp" "struct mtx *mp"
.Ft int
.Fn cv_timedwait "struct cv *cvp" "struct mtx *mp" "int timo"
.Ft int
@@ -84,6 +87,7 @@ Condition variables are destroyed with
Threads wait on condition variables by calling
.Fn cv_wait ,
.Fn cv_wait_sig ,
+.Fn cv_wait_unlock ,
.Fn cv_timedwait ,
or
.Fn cv_timedwait_sig .
@@ -110,13 +114,17 @@ A thread must hold
before calling
.Fn cv_wait ,
.Fn cv_wait_sig ,
+.Fn cv_wait_unlock ,
.Fn cv_timedwait ,
or
.Fn cv_timedwait_sig .
When a thread waits on a condition,
.Fa mp
-is atomically released before the thread is blocked, then atomically reacquired
+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
in conjunction with
@@ -125,6 +133,7 @@ in conjunction with
When
.Fn cv_wait ,
.Fn cv_wait_sig ,
+.Fn cv_wait_unlock ,
.Fn cv_timedwait ,
and
.Fn cv_timedwait_sig
OpenPOWER on IntegriCloud