maintains a pair of associated locks - one for reading and other for
writing operation. ReadLock in this pair may be held simultaneously
by multiple reader threads, so long as there are no writers.
WriteLock is exclusive.
has two methods :
Lock readLock ()
Lock writeLock ()
you create an instance of ReadWriteLock and then obtain the two locks
using the 2 methods above. Then while reading, readLock is
locked/unlocked and while writing, writeLock is locked/unlocked.