"It acquires a write lock instead of a read lock because it walks the
history chain to get the count and needs to prevent other threads from
modifying the chain while it does this."
However, acquiring a read lock would seem to serve the same purpose. I
believe the chain of TVal objects is only modified when the write lock
is held and that can't happen if another thread holds a read lock.
--
R. Mark Volkmann
Object Computing, Inc.