Collections.synchronizedMap(new HashMap())的問題

Map m = Collections.synchronizedMap(new HashMap());  Set s = m.keySet();  // Needn't be in synchronized block  synchronized(m) {  // Synchronizing on m, not s!      Iterator i = s.iterator(); // Must
相關文章
相關標籤/搜索