Reword descriptions of asserting locks held without WITNESS.

This corrects an error in r296947 in that it is not possible to assert
which thread holds a shared (or read) lock, but it is possible to assert
that one is held.  Just not very useful.

MFC after:	1 week
Submitted by:	wblock, jhb
Reviewed by:	kib (earlier version), jhb, wblock
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D5659
This commit is contained in:
Bryan Drewery 2016-03-29 16:07:51 +00:00
parent 2dfe93f0ab
commit a23b48fee5
2 changed files with 21 additions and 15 deletions

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 13, 2014
.Dd March 28, 2016
.Dt RWLOCK 9
.Os
.Sh NAME
@ -313,18 +313,19 @@ facility was written by
This manual page was written by
.An "Gleb Smirnoff" .
.Sh BUGS
If
A kernel without
.Dv WITNESS
is not included in the kernel,
then it is impossible to assert that the current thread does or does not
hold a read lock.
In the
.Pf non- Dv WITNESS
case, the
cannot assert whether the current thread does or does not hold a read lock.
.Dv RA_LOCKED
and
.Dv RA_RLOCKED
assertions merely check that some thread holds a read lock.
can only assert that
.Em any
thread holds a read lock.
They cannot ensure that the current thread holds a read lock.
Further,
.Dv RA_UNLOCKED
can only assert that the current thread does not hold a write lock.
.Pp
Reader/writer is a bit of an awkward name.
An

View File

@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd March 16, 2016
.Dd March 28, 2016
.Dt SX 9
.Os
.Sh NAME
@ -320,11 +320,16 @@ end up sleeping while holding a mutex, which is not allowed.
.Xr rwlock 9 ,
.Xr sema 9
.Sh BUGS
In the
.No non- Ns Dv WITNESS
case, the
A kernel without
.Dv WITNESS
cannot assert whether the current thread does or does not hold a shared lock.
.Dv SA_LOCKED
and
.Dv SA_SLOCKED
assertions merely check that some thread holds a shared lock.
They do not ensure that the current thread holds a shared lock.
can only assert that
.Em any
thread holds a shared lock.
They cannot ensure that the current thread holds a shared lock.
Further,
.Dv SA_UNLOCKED
can only assert that the current thread does not hold an exclusive lock.