Details
Description
The ObjectLock class uses custom mechanism to implement the read/write locks, and it is too complicated and error-prone. This issue will try use the java.util.concurrent.locks.ReentrantReadWriteLock to refactor the ObjectLock class.
I think there are something should be refactored.
(1) Use ReentrantLock and ReentrantReadWriteLock to replace the old wait() and notify();
(2) Simplify the usage of ObjectLock’s apis, for example, confirm ();
(3) Refactor some variables’ names to make them more intuitive.