summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-05-29 10:52:37 +0000
committerrwatson <rwatson@FreeBSD.org>2009-05-29 10:52:37 +0000
commit52ba25996039c990d61c87ec08ee18c634d5e1ae (patch)
treebcd8f26df00704f44c24b12794f3b744baf80489 /share
parentbe2772a684b761a0e896a5808a48c30e67fdbbe5 (diff)
downloadFreeBSD-src-52ba25996039c990d61c87ec08ee18c634d5e1ae.zip
FreeBSD-src-52ba25996039c990d61c87ec08ee18c634d5e1ae.tar.gz
Make the rmlock(9) interface a bit more like the rwlock(9) interface:
- Add rm_init_flags() and accept extended options only for that variation. - Add a flags space specifically for rm_init_flags(), rather than borrowing the lock_init() flag space. - Define flag RM_RECURSE to use instead of LO_RECURSABLE. - Define flag RM_NOWITNESS to allow an rmlock to be exempt from WITNESS checking; this wasn't possible previously as rm_init() always passed LO_WITNESS when initializing an rmlock's struct lock. - Add RM_SYSINIT_FLAGS(). - Rename embedded mutex in rmlocks to make it more obvious what it is. - Update consumers. - Update man page.
Diffstat (limited to 'share')
-rw-r--r--share/man/man9/rmlock.930
1 files changed, 24 insertions, 6 deletions
diff --git a/share/man/man9/rmlock.9 b/share/man/man9/rmlock.9
index 1be822b..e99661d 100644
--- a/share/man/man9/rmlock.9
+++ b/share/man/man9/rmlock.9
@@ -32,6 +32,7 @@
.Sh NAME
.Nm rmlock ,
.Nm rm_init ,
+.Nm rm_init_flags ,
.Nm rm_destroy ,
.Nm rm_rlock ,
.Nm rm_wlock ,
@@ -45,7 +46,9 @@
.In sys/lock.h
.In sys/rmlock.h
.Ft void
-.Fn rm_init "struct rmlock *rm" "const char *name" "int opts"
+.Fn rm_init "struct rmlock *rm" "const char *name"
+.Ft void
+.Fn rm_init_flags "struct rmlock *rm" "const char *name" "int opts"
.Ft void
.Fn rm_destroy "struct rmlock *rm"
.Ft void
@@ -106,18 +109,33 @@ can recurse if the lock has been initialized with the
option, however exclusive locks are not allowed to recurse.
.Ss Macros and Functions
.Bl -tag -width indent
-.It Fn rm_init "struct rmlock *rm" "const char *name" "int opts"
+.It Fn rm_init "struct rmlock *rm" "const char *name"
Initialize structure located at
.Fa rm
as mostly reader lock, described by
.Fa name .
-Optionally allowing readers to recurse by setting
-.Dv LO_RECURSABLE
-in
-.Fa opts .
The name description is used solely for debugging purposes.
This function must be called before any other operations
on the lock.
+.It Fn rm_init_flags "struct rmlock *rm" "const char *name" "int opts"
+Initialize the rm lock just like the
+.Fn rm_init
+function, but specifying a set of optional flags to alter the
+behaviour of
+.Fa rm ,
+through the
+.Fa opts
+argument.
+It contains one or more of the following flags:
+.Bl -tag -width ".Dv RM_NOWITNESS"
+.It Dv RM_NOWITNESS
+Instruct
+.Xr witness 4
+to ignore this lock.
+.It Dv RM_RECURSE
+Allow threads to recursively acquire exclusive locks for
+.Fa rm .
+.El
.It Fn rm_rlock "struct rmlock *rm" "struct rm_priotracker* tracker"
Lock
.Fa rm
OpenPOWER on IntegriCloud