Class SynchronizedCollection

  • All Implemented Interfaces:
    kotlin.collections.Collection , kotlin.collections.Iterable , kotlin.collections.MutableCollection , kotlin.collections.MutableIterable

    
    public class SynchronizedCollection<E extends Object>
     implements Collection<E>
                        

    Decorates another MutableCollection to synchronize its behavior for a multithreaded environment.

    Iterators must be manually synchronized:

    synchronized (coll) {
      Iterator it = coll.iterator();
      // do stuff with iterator
    }