summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gallatin <gallatin@FreeBSD.org>2002-10-21 12:54:13 +0000
committerAndrew Gallatin <gallatin@FreeBSD.org>2002-10-21 12:54:13 +0000
commit777bca5e2087910e4dc701a3c27579bfcdf83747 (patch)
tree02a982774955114e9a72a512db500717268edccd
parentf7f1a3e39b728a0731470ffe1e358983ae2dd097 (diff)
Notes
-rw-r--r--share/man/man9/mutex.920
1 files changed, 20 insertions, 0 deletions
diff --git a/share/man/man9/mutex.9 b/share/man/man9/mutex.9
index 3198b5f3be92..50bb085759fd 100644
--- a/share/man/man9/mutex.9
+++ b/share/man/man9/mutex.9
@@ -457,6 +457,26 @@ This option is used to quiet logging messages during individual mutex
operations.
This can be used to trim superfluous logging messages for debugging purposes.
.El
+.Ss Giant
+If Giant must be acquired, it must be acquired prior to acquiring
+other mutexes.
+Put another way: it is impossible to acquire Giant non-recursively while
+holding another mutex.
+It is possible to acquire other mutexes while holding Giant, and it is
+possible to acquire Giant recursively while holding other mutexes.
+.Ss Sleeping
+Sleeping while holding a mutex (except for Giant) is almost never safe
+and should be avoided.
+There are numerous assertions which will fail if this is attempted.
+.Ss Functions Which Access Memory in Userspace
+No mutexes should be held (except for Giant) across functions which
+access memory in userspace, such as
+.Xr copyin 9 ,
+.Xr copyout 9 ,
+.Xr uiomove 9 ,
+.Xr fuword 9 ,
+etc.
+No locks are needed when calling these functions.
.Sh SEE ALSO
.Xr condvar 9 ,
.Xr msleep 9 ,