【发布时间】:2012-07-03 10:19:01
【问题描述】:
考虑以下代码:
// This code safely publishes the Publishable object
public static Publishable publishable= new Publishable();
我见过这样一种发布自定义 Publishable 对象的方式,并且我读到这是安全的。我的问题是:
- 这是一种真的安全发布方式吗?
- 如果 1 的答案是否定的,那为什么?如果是,还请解释原因?
【问题讨论】:
标签: java multithreading synchronization thread-safety