Posted By:
WarnerJan_Veldhuis
Posted On:
Saturday, May 5, 2007 08:19 AM
make the the adding of the value synchronized:
public synchronized addValue(int value) {
theCollection.add(value);
}
You can also work with a synchronized List:
List theCollection = Collections.synchronizedList(new ArrayList());