diff options
author | jasone <jasone@FreeBSD.org> | 2001-08-07 04:29:53 +0000 |
---|---|---|
committer | jasone <jasone@FreeBSD.org> | 2001-08-07 04:29:53 +0000 |
commit | 0619ea75c37f69936602cf5923c7876f1e18429e (patch) | |
tree | 65c9d48fd2683db5b731020dc05e55e8578247e6 | |
parent | b0dfeae7a34e146e7c84d7874d366c3d97649060 (diff) | |
download | FreeBSD-src-0619ea75c37f69936602cf5923c7876f1e18429e.zip FreeBSD-src-0619ea75c37f69936602cf5923c7876f1e18429e.tar.gz |
Document sx_try_[sx]lock().
-rw-r--r-- | share/man/man9/Makefile | 2 | ||||
-rw-r--r-- | share/man/man9/sx.9 | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index dd5f3d8..53195bb 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -164,6 +164,8 @@ MLINKS+=sx.9 sx_init.9 MLINKS+=sx.9 sx_destroy.9 MLINKS+=sx.9 sx_slock.9 MLINKS+=sx.9 sx_xlock.9 +MLINKS+=sx.9 sx_try_slock.9 +MLINKS+=sx.9 sx_try_xlock.9 MLINKS+=sx.9 sx_sunlock.9 MLINKS+=sx.9 sx_xunlock.9 MLINKS+=time.9 boottime.9 time.9 mono_time.9 time.9 runtime.9 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 |