April 05
Prde. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
Exemplos
nMap m = Collections.synchronizedMap(new HashMap());
n  ...
nSet s = m.keySet();  // Needn't be in synchronized block
n  ...
nsynchronized(m) {            // Synchronizing on m, not s!
n  Iterator i = s.iterator(); // Must be in synchronized block
n  while(i.hasNext())
n   foo(i.next());
n}