summaryrefslogtreecommitdiffstats
path: root/share/man/man9
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-07-12 15:40:35 +0000
committerpjd <pjd@FreeBSD.org>2006-07-12 15:40:35 +0000
commit07ad858feec96a88c5137685ef6bd05081c7fcbd (patch)
tree4d6feba235a59ac5603a7b6c2d44fd22c3e78a0c /share/man/man9
parent4b477bd640a0cde8210c22a8af1aa5120eb0f21a (diff)
downloadFreeBSD-src-07ad858feec96a88c5137685ef6bd05081c7fcbd.zip
FreeBSD-src-07ad858feec96a88c5137685ef6bd05081c7fcbd.tar.gz
Document sx_xlocked(9).
Submitted by: ssouhlal
Diffstat (limited to 'share/man/man9')
-rw-r--r--share/man/man9/Makefile3
-rw-r--r--share/man/man9/sx.97
2 files changed, 9 insertions, 1 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index e4e6061..95e83d4 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1012,7 +1012,8 @@ MLINKS+=sx.9 sx_assert.9 \
sx.9 sx_try_upgrade.9 \
sx.9 sx_try_xlock.9 \
sx.9 sx_xlock.9 \
- sx.9 sx_xunlock.9
+ sx.9 sx_xunlock.9 \
+ sx.9 sx_xlocked.9
MLINKS+=sysctl_add_oid.9 SYSCTL_ADD_INT.9 \
sysctl_add_oid.9 SYSCTL_ADD_LONG.9 \
sysctl_add_oid.9 SYSCTL_ADD_NODE.9 \
diff --git a/share/man/man9/sx.9 b/share/man/man9/sx.9
index d89c186..5a60fd1 100644
--- a/share/man/man9/sx.9
+++ b/share/man/man9/sx.9
@@ -43,6 +43,7 @@
.Nm sx_downgrade ,
.Nm sx_assert ,
.Nm sx_unlock ,
+.Nm sx_xlocked ,
.Nm SX_SYSINIT
.Nd kernel shared/exclusive lock
.Sh SYNOPSIS
@@ -71,6 +72,8 @@
.Fn sx_downgrade "struct sx *sx"
.Ft void
.Fn sx_assert "struct sx *sx" "int what"
+.Ft int
+.Fn sx_xlocked "struct sx *sx"
.\"
.Ss Nm Ss utility macros
.Fn sx_unlock "struct sx *sx"
@@ -166,6 +169,10 @@ lock pointed to
by the first argument.
.El
.Pp
+.Fn sx_xlocked
+will return non-zero if the current process holds the exclusive lock;
+otherwise, it will return zero.
+.Pp
For ease of programming,
.Fn sx_unlock
is provided as a macro frontend to the respective functions,
OpenPOWER on IntegriCloud