Created
August 12, 2014 05:10
-
-
Save ChinaXing/be4f0f316bacb5656717 to your computer and use it in GitHub Desktop.
for 循环迭代对并发修改是否会抛出异常
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map<String,Object> map = new HashMap<String, Object>(); | |
// Thread 1 | |
for(Entry<String,Object> entry : map.entrySet()){ | |
// print entry content; | |
} | |
// Thread 2 | |
map.put("Key1",new Object()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment