mutateAndSnapshot

inline fun mutateAndSnapshot(mutator: MutableMap<K, V>.() -> Unit): ImmutableMap<K, V>

Mutates this map atomically and returns the new snapshot. mutator can be evaluated multiple times if a concurrent edit occurs.