Removed spin lock and exchanged it with CountDownLatch for MapReduce