]> git.ipfire.org Git - thirdparty/squid.git/commit
Make !lock.readers and !lock.writers assertions safe.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 21 Jun 2013 22:04:04 +0000 (16:04 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 21 Jun 2013 22:04:04 +0000 (16:04 -0600)
commit92e297979096e99bcb872178b03a47747dc310a5
treef0bf093e1957686da7ceb9453454bae1c4cb7d60
parentad40da437bb8429db775e34bbfa861b9ed501da4
Make !lock.readers and !lock.writers assertions safe.

The lock class used readers level counter to count both attempts to read and
current readers. The attempts part made assertions declaring that there should
be no readers unsafe because even a writing entry may have a reading attempt.
Same for writers counter: A reading entry may have a writing attempt.

We now segragate the attempts level, which is internal information required
for shared lock to work, from counting the number of successful attempts
(i.e., actual readers and writers), which is public information useful for
assertions, stats, etc.
src/ipc/ReadWriteLock.cc
src/ipc/ReadWriteLock.h