ReadWriteLock. Understanding upgrading from readLock to writeLock
问题 Consider this JDK standard interface: public interface ReadWriteLock{ public Lock readLock(); public Lock writeLock(); } B. Goetz in Java Concurrency in practice mentioned upgrading from readLock to writeLock is deadlock-prone. If two readers simultaneously attempt to upgrade to a write lock, neither will realese the read lock. The thing that's confused me is that it was two readers attempting to upgrade. But even one reader is enough, isn't? If a reader tries to upgrade it's not released the