并发编程中的竞态条件:synchronized 能解决什么、不能解决什么从一段有 bug 的自增代码出发,梳理 Java 内存模型、JMM 可见性问题,以及 volatile、Atomic、锁各自的适用边界。