summaryrefslogtreecommitdiffstats
path: root/share/man/man9
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-04-19 21:09:17 +0000
committerjhb <jhb@FreeBSD.org>2006-04-19 21:09:17 +0000
commit23bed816e268b41f463bbe650778c5dcc90357e1 (patch)
treee965ef025c29e4f439dc04d5b9cfb5d62f4902cc /share/man/man9
parent99cfbe57d47e937d7f8336f08ec4443042e4895b (diff)
downloadFreeBSD-src-23bed816e268b41f463bbe650778c5dcc90357e1.zip
FreeBSD-src-23bed816e268b41f463bbe650778c5dcc90357e1.tar.gz
Document rw_try_upgrade() and rw_downgrade().
Diffstat (limited to 'share/man/man9')
-rw-r--r--share/man/man9/rwlock.923
1 files changed, 23 insertions, 0 deletions
diff --git a/share/man/man9/rwlock.9 b/share/man/man9/rwlock.9
index 5411adf..34105fc 100644
--- a/share/man/man9/rwlock.9
+++ b/share/man/man9/rwlock.9
@@ -54,6 +54,10 @@
.Ft void
.Fn rw_wunlock "struct rwlock *rw"
.Ft int
+.Fn rw_try_upgrade "struct rwlock *rw"
+.Ft void
+.Fn rw_downgrade "struct rwlock *rw"
+.Ft int
.Fn rw_initialized "struct rwlock *rw"
.Ft void
.Fn rw_destroy "struct rwlock *rw"
@@ -134,6 +138,25 @@ This function releases a shared lock previously acquired by
.It Fn rw_wunlock "struct rwlock *rw"
This function releases an exclusive lock previously acquired by
.Fn rw_wlock .
+.It Fn rw_try_upgrade "struct rwlock *rw"
+Attempt to upgrade a single shared lock to an exclusive lock.
+The current thread must hold a shared lock of
+.Fa rw .
+This will only succeed if the current thread holds the only shared lock on
+.Fa rw ,
+and it only holds a single shared lock.
+If the attempt succeeds
+.Fn rw_try_upgrade
+will return a non-zero value,
+and the current thread will hold an exclusive lock.
+If the attempt fails
+.Fn rw_try_upgrade
+will return zero,
+and the current thread will still hold a shared lock.
+.It Fn rw_downgrade "struct rwlock *rw"
+Convert an exclusive lock into a single shared lock.
+The current thread must hold an exclusive lock of
+.Fa rw .
.It Fn rw_initialized "struct rwlock *rw"
This function returns non-zero if
.Fa rw
OpenPOWER on IntegriCloud