synchronized()
同步普通方法,锁的是当前对象。
同步静态方法,锁的是当前 Class 对象。
同步块,锁的是 () 中的对象
Last updated 5 years ago
Was this helpful?