// Take a snapshot of the hashtable.
Map.Entry[] entries = ( Map.Entry[] ) ht.entrySet().toArray( new Map.Entry[0] );
//p("RwLockHolder garbage collecting...");
for ( int i = 0; i < entries.length; i++ )
{
RwLockHolder holder = ( RwLockHolder ) entries[i].getValue();
if ( holder.removable( now ) )
{
Object key = entries[i].getKey();
synchronized ( ht )
{
holder = ( RwLockHolder ) ht.get( key );
// holder cannot possibly be null as this should be the only thread removing them.
if ( holder.removable( now ) )
{
ht.remove( key );
/*
* p("removing key=" + key + ", now=" + now + ", holder.lastInactiveTime="
* + holder.lastInactiveTime);