Java : Call of notify() in synchronized block