diff options
author | John Baldwin <jhb@FreeBSD.org> | 2007-03-09 16:59:27 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2007-03-09 16:59:27 +0000 |
commit | e6b69890edf6ded65bd51e211a8387ba33344928 (patch) | |
tree | a3d010bc8d1234efba13a07d5cf7c37d2a6ae1d1 | |
parent | b58aa2bde766b187bde3fe04a25452c469ab4298 (diff) | |
download | src-e6b69890edf6ded65bd51e211a8387ba33344928.tar.gz src-e6b69890edf6ded65bd51e211a8387ba33344928.zip |
- 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.
Notes
Notes:
svn path=/head/; revision=167373
-rw-r--r-- | share/man/man9/Makefile | 1 | ||||
-rw-r--r-- | share/man/man9/condvar.9 | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index af7bac213ef2..64793deb57f0 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 1a8730e9bcc5..97d3134f847f 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 |