Originally posted by Mark Savory:
...
public class Test {
Hashtable table = new Hashtable();
public void add(String name, String value) {
synchronized (table) {
if (table.get(name) == null)
table.put(name, value);
}
}
public void somethingelse() {
// Code...
}
}
[This message has been edited by Mark Savory (edited March 02, 2001).][/B]
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Originally posted by Mark Savory:
What is the purpose of calling Collections.synchronizedMap()?
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
You know it is dark times when the trees riot. I think this tiny ad is their leader:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|