public void testTimedWriteLocks() throws InterruptedException {
ReadWriteLockWithUpgrade l = new ReadWriteLockWithUpgrade();
final int NUM=1000000;
for(int i=0; i < NUM; i++) {
l.writeLock().attempt(2000);
l.writeLock().release();
if(i % 10000 == 0)
System.out.println(i);
}
}