synchronized 同步代码块静态类使用
时间:2021-08-19 08:43:32
收藏:0
阅读:22
非静态
synchronized 方法 等于synchronized(this)
静态
synchronized(类名.class)
线程安全的类StringBuffer Hashtable 多线程的时候用这两个 血和泪的教训!
补充
Hashtable 基本被
List<String> list= Collections.synchronizedList(new ArrayList<String>());替代了
原文:https://www.cnblogs.com/joenSu/p/15158466.html
评论(0)