document the rw_assert_ functions
authorblambert <blambert@openbsd.org>
Sun, 1 Aug 2010 14:21:10 +0000 (14:21 +0000)
committerblambert <blambert@openbsd.org>
Sun, 1 Aug 2010 14:21:10 +0000 (14:21 +0000)
ok jmc@

share/man/man9/Makefile
share/man/man9/rwlock.9

index fcf9e0f..b87f594 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.156 2009/09/08 06:01:41 deraadt Exp $
+#      $OpenBSD: Makefile,v 1.157 2010/08/01 14:21:10 blambert Exp $
 #      $NetBSD: Makefile,v 1.4 1996/01/09 03:23:01 thorpej Exp $
 
 #      Makefile for section 9 (kernel function and variable) manual pages.
@@ -265,7 +265,9 @@ MLINKS+=rssadapt.9 ieee80211_rssadapt_choose.9 \
        rssadapt.9 ieee80211_rssadapt_updatestats.9
 MLINKS+=rwlock.9 rw_init.9 rwlock.9 rw_enter.9 rwlock.9 rw_exit.9 \
        rwlock.9 rw_enter_read.9 rwlock.9 rw_enter_write.9 \
-       rwlock.9 rw_exit_read.9 rwlock.9 rw_exit_write.9 
+       rwlock.9 rw_exit_read.9 rwlock.9 rw_exit_write.9 \
+       rwlock.9 rw_assert_wrlock.9 rwlock.9 rw_assert_rdlock.9 \
+       rwlock.9 rw_assert_unlocked.9
        
 MLINKS+=sensor_attach.9 sensordev_install.9 \
        sensor_attach.9 sensordev_deinstall.9 \
index 23e5e8e..ae7056f 100644 (file)
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rwlock.9,v 1.8 2007/12/09 20:54:01 jmc Exp $
+.\" $OpenBSD: rwlock.9,v 1.9 2010/08/01 14:21:10 blambert Exp $
 .\"
 .\" Copyright (c) 2006 Pedro Martelletto <pedro@ambientworks.net>
 .\" All rights reserved.
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd $Mdocdate: December 9 2007 $
+.Dd $Mdocdate: August 1 2010 $
 .Dt RWLOCK 9
 .Os
 .Sh NAME
 .Fn rw_exit_read "struct rwlock *rwl"
 .Ft void
 .Fn rw_exit_write "struct rwlock *rwl"
+.Ft void
+.Fn rw_assert_wrlock "struct rwlock *rwl"
+.Ft void
+.Fn rw_assert_rdlock "struct rwlock *rwl"
+.Ft void
+.Fn rw_assert_unlocked "struct rwlock *rwl"
 .Sh DESCRIPTION
 The
 .Nm
@@ -112,6 +118,15 @@ Read locks can be acquired while the write lock is not held, and may coexist in
 distinct processes at any time.
 A write lock, however, can only be acquired when there are no read locks held,
 granting exclusive access to a single process.
+.Pp
+The
+.Fn rw_assert_wrlock ,
+.Fn rw_assert_rdlock ,
+and
+.Fn rw_assert_unlocked
+functions check the status
+.Fa rwl ,
+panicking if it is not write-, read-, or unlocked, respectively.
 .Sh SEE ALSO
 .Xr lockmgr 9 ,
 .Xr mutex 9 ,