replace condvar with CountDownLatch
fix renamed file counting