标签:
public class ThreadA implements Runnable{
public static int number;
public String test;
@Override
public void run() {
while(true){
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
number是共享资源,属于非线程安全,test属于线程安全
标签:
原文地址:http://www.cnblogs.com/flycoding/p/5914614.html