Change wait notify to countdown latch