public class TSynchronizedIntSets extends Object
public static TIntSetwrap(TIntSet s)
It is imperative that the user manually synchronize on the returned set when iterating over it:
TIntSet s = TSynchronizedIntSets.wrap( new TIntHashSet() );
...
synchronized(s) {
TIntIterator i = s.iterator(); // Must be in the synchronized block
while ( i.hasNext() )
foo( i.next() );
}
Failure to follow this advice may result in non-deterministic behavior.
The returned set will be serializable if the specified set is serializable.
s - the set to be "wrapped" in a synchronized set.