docs: private void removeTimedOutLocks(long timeout)
      {
          int count = 0;
          long maxAge = System.currentTimeMillis() - timeout;
          boolean breakFromLoop = false;
          ObjectLocks temp = null;
      	synchronized (locktable)
      	{
  	        Iterator it = locktable.values().iterator();
  	        /**
  	         * run this loop while:
  	         * - we have more in the iterator
  	         * - the breakFromLoop flag hasn't been set
  	         * - we haven't removed more than the limit for this cleaning iteration.
  	         */
  	        while (it.hasNext() && !breakFromLoop && (count <= MAX_LOCKS_TO_CLEAN))
  	        {
  	        	temp = (ObjectLocks) it.next();
  	        	if (temp.getWriter() != null)
  	        	{
  		        	if (temp.getWriter().getTimestamp() < maxAge)
  		        	{
  		        		// writer has timed out, set it to null
  		        		temp.setWriter(null);
  		        	}
  	        	}
  	        	if (temp.getYoungestReader() < maxAge)
  	        	{
  	        		// all readers are older than timeout.
  	        		temp.getReaders().clear();
  	        		if (temp.getWriter() == null)
  	        		{
  	        			// all readers and writer are older than timeout,
  	        			// remove the objectLock from the iterator (which
  	        			// is backed by the map, so it will be removed.
  	        			it.remove();
  	        		}
  	        	}
  	        	else
  	        	{
  	        		// we need to walk each reader.
  	        		Iterator readerIt = temp.getReaders().values().iterator();
  	        		LockEntry readerLock = null;
  	        		while (readerIt.hasNext())
  	        		{
  	        			readerLock = (LockEntry) readerIt.next();
  	        			if (readerLock.getTimestamp() < maxAge)
  	        			{
  	        				// this read lock is old, remove it.
  	        				readerIt.remove();
  	        			}
  	        		}
  	        	}
  	        	count++;
  	        }
      	}
      }