这是构造函数:
public LoaderImpl ()
{
fileName2ModifiedMap_ = new ConcurrentHashMap<String, Boolean>();
fileName2NameMap_ = new ConcurrentHashMap<String, String>();
rule2FileNameMap_ = new ConcurrentHashMap<String, String>();
rule2RuleFileMap_ = new ConcurrentHashMap<String, RuleFile>();
ruleName2RunnerMap_ = new ThreadLocal<Map<String, Runner>>();
}
我正在阅读这段代码,想知道为什么将ThreadLocal用于保护地图?为什么与前四个地图一样,ConcurrentHashMap也不能正常工作?或者只是作者选择两者之一的偏好。