Producer – Consumer problem in Java Multithreading