synchronized 修饰符

https://docs.oracle.com/javase/tutorial/essential/concurrency/locksync.html
Another way to create synchronized code is with synchronized statements. Unlike synchronized methods, synchronized statements must specify the object that provides the intrinsic lock:

https://www.runoob.com/java/java-modifier-types.html
synchronized 关键字声明的方法同一时间只能被一个线程访问。

posted @ 2025-04-15 15:20  kuki'  阅读(13)  评论(0)    收藏  举报