public synchronized void commit(){
synchronized (mutex) {
    Map<Column,Set<Interval>> temp=workingIntervals;
    workingIntervals=Collections.synchronizedMap(new LinkedHashMap<>());
    availableIntervalsRef.set(Collections.unmodifiableMap(new LinkedHashMap<>(temp)));
    super.columns=new LinkedHashSet<>(temp.keySet());
  }
}

public synchronized void commit ( ) { synchronized ( mutex ) { Map < Column , Set < Interval > > temp = workingIntervals ; workingIntervals = Collections . synchronizedMap ( new LinkedHashMap < > ( ) ) ; availableIntervalsRef . set ( Collections . unmodifiableMap ( new LinkedHashMap < > ( temp ) ) ) ; super . columns = new LinkedHashSet < > ( temp . keySet ( ) ) ; } }
swaps the actual cache with the built - up temporary cache and creates a fresh , empty temporary cache .
