svn commit: r313784 - head/sys/sys
Mateusz Guzik
mjg at FreeBSD.org
Wed Feb 15 23:33:15 UTC 2017
Author: mjg
Date: Wed Feb 15 23:33:14 2017
New Revision: 313784
URL: https://svnweb.freebsd.org/changeset/base/313784
Log:
rwlock: tidy up r313392
While a new bit was added and thread alignment got shifted to accomodate it,
RW_READERS_SHIFT was not modified accordingly and clashed with the new flag.
This was surprisingly harmless. If the lock was taken for writing, other flags
were tested. If the lock was taken for reading, it would correctly work for
readers > 1 and this was the only relevant test performed.
Modified:
head/sys/sys/rwlock.h
Modified: head/sys/sys/rwlock.h
==============================================================================
--- head/sys/sys/rwlock.h Wed Feb 15 23:04:25 2017 (r313783)
+++ head/sys/sys/rwlock.h Wed Feb 15 23:33:14 2017 (r313784)
@@ -65,7 +65,7 @@
#define RW_LOCK_WAITERS (RW_LOCK_READ_WAITERS | RW_LOCK_WRITE_WAITERS)
#define RW_OWNER(x) ((x) & ~RW_LOCK_FLAGMASK)
-#define RW_READERS_SHIFT 4
+#define RW_READERS_SHIFT 5
#define RW_READERS(x) (RW_OWNER((x)) >> RW_READERS_SHIFT)
#define RW_READERS_LOCK(x) ((x) << RW_READERS_SHIFT | RW_LOCK_READ)
#define RW_ONE_READER (1 << RW_READERS_SHIFT)
More information about the svn-src-head
mailing list