Code example for ReentrantReadWriteLock

  private final ReadWriteLock _readWriteLock;
  protected ReadWriteSyncedObject(boolean threadSafe)
    _readWriteLock = threadSafe ? new ReentrantReadWriteLock(true) : null;
  public boolean isThreadSafe() 
    return null != _readWriteLock;
   * Obtains a read lock if required. If the lock is acquired in a relation with another lock, 
   * it will do so in a way that avoids deadlocks. 
   * @param  otherLock          the other lock; can be null; otherwise, must be locked 
   * @return the read lock or null if not required 
  protected Lock acquireReadLock(Lock otherLock)