How to use the ReadWriteLock interface.