. . "(Ok, I will give some hints: look the description of such methods as Object.wait() and Object.notifyAll() it is the simpliest but also very usefull mechanism)" . .