summaryrefslogtreecommitdiffstats
path: root/share/man/man9/sx.9
diff options
context:
space:
mode:
authorjasone <jasone@FreeBSD.org>2001-08-07 04:29:53 +0000
committerjasone <jasone@FreeBSD.org>2001-08-07 04:29:53 +0000
commit0619ea75c37f69936602cf5923c7876f1e18429e (patch)
tree65c9d48fd2683db5b731020dc05e55e8578247e6 /share/man/man9/sx.9
parentb0dfeae7a34e146e7c84d7874d366c3d97649060 (diff)
downloadFreeBSD-src-0619ea75c37f69936602cf5923c7876f1e18429e.zip
FreeBSD-src-0619ea75c37f69936602cf5923c7876f1e18429e.tar.gz
Document sx_try_[sx]lock().
Diffstat (limited to 'share/man/man9/sx.9')
-rw-r--r--share/man/man9/sx.917
1 files changed, 17 insertions, 0 deletions
diff --git a/share/man/man9/sx.9 b/share/man/man9/sx.9
index 5fa5dd3..acb0880 100644
--- a/share/man/man9/sx.9
+++ b/share/man/man9/sx.9
@@ -35,6 +35,8 @@
.Nm sx_destroy ,
.Nm sx_slock ,
.Nm sx_xlock ,
+.Nm sx_try_slock ,
+.Nm sx_try_xlock ,
.Nm sx_sunlock ,
.Nm sx_xunlock
.Nd kernel shared/exclusive lock
@@ -51,6 +53,10 @@
.Fn sx_slock "struct sx *sx"
.Ft void
.Fn sx_xlock "struct sx *sx"
+.Ft int
+.Fn sx_try_slock "struct sx *sx"
+.Ft int
+.Fn sx_try_xlock "struct sx *sx"
.Ft void
.Fn sx_sunlock "struct sx *sx"
.Ft void
@@ -75,13 +81,24 @@ Shared/exclusive locks are destroyed with
.Fn sx_destroy .
Threads acquire and release a shared lock by calling
.Fn sx_slock
+or
+.Fn sx_try_slock
and
.Fn sx_sunlock .
Threads acquire and release an exclusive lock by calling
.Fn sx_xlock
+or
+.Fn sx_try_xlock
and
.Fn sx_xunlock .
.Pp
+.Fn sx_try_slock
+and
+.Fn sx_try_xlock
+will return 0 if the shared/exclusive lock cannot be acquired immediately;
+otherwise the shared/exclusive lock will be acquired and a non-zero value will
+be returned.
+.Pp
A thread may not own a shared lock and an exclusive lock simultaneously;
attempting to do so will result in deadlock.
.Sh SEE ALSO
OpenPOWER on IntegriCloud