some multithreading code with atomic in Java