Are read and write locks in ReentrantReadWriteLock somehow related?
问题 Please explain me more the contract. I can't figure out if two locks contained in ReentrantReadWriteLock somehow related? Or these are just a bundle of two normal locks? 回答1: If threads are waiting Read Lock it is shared but when thread wants to acquire write lock only that thread is allowed the access same as mutual exclusion. So either one of operation is allowed . if lock is held by readers and thread request write lock no more readers are allowed to acquire read lock until thread which