java 进程的参数和list的线程安全
2021-05-29 23:04
implements Runnable { @Autowired @Override public void setList(List
private MongoTemplate mongoTemplate;
private static List
public static Logger logger = LoggerFactory.getLogger(RobotRun.class);
public RobotRun(List
list=list1;
mongoTemplate = (MongoTemplate) AllBeanService.getBean(MongoTemplate.class);
}
public void run() {
logger.info("list:"+list.size());
mongoTemplate.insert(list,"robot");
list.clear();
logger.info("添加成功:"+list.size());
}
this.list = list;
}
}
上一篇:Java反射详解
文章标题:java 进程的参数和list的线程安全
文章链接:http://soscw.com/index.php/essay/89297.html