Out of curiosity, why is `read` extension method a...
# random
a
Out of curiosity, why is
read
extension method added on
ReentrantReadWriteLock
and not the interface
ReadWriteLock
?
1
h
I'd guess it is because what exactly needs to be performed may vary between implementation of that interface. For example for
ReentrantReadWriteLock.write
attempts to "upgrade" from a read lock to a write lock if neccessary by releasing all read locks, obtaining a write lock, performing the task, then acquiring the read locks again.
👍 1