map是一个线程不安全的集合类,主要原因就是其读写方法并没有加锁 解决方法: 使用Collections.synchronizedMap(map)包装map使用juc里的ConcurrentHashMap替代map