Automated g4 rollback of changelist 662071950.

*** Reason for rollback ***

Rolling back while investigating tsan reports.

*** Original change description ***

Remove a volatile read/write in SmallSortedMap.entrySet()

I don't know why this was volatile.

Volatile semantics are not strong enough for making this read-then-write a
transaction. You'd need a mutex or AtomicReference to achieve that.

***

PiperOrigin-RevId: 662300377
pull/17794/head
Mark Hansen 4 months ago committed by Copybara-Service
parent b71e5ee2d5
commit 769305467a
  1. 2
      java/core/src/main/java/com/google/protobuf/SmallSortedMap.java

@ -106,7 +106,7 @@ class SmallSortedMap<K extends Comparable<K>, V> extends AbstractMap<K, V> {
private boolean isImmutable;
// The EntrySet is a stateless view of the Map. It's initialized the first
// time it is requested and reused henceforth.
private EntrySet lazyEntrySet;
private volatile EntrySet lazyEntrySet;
private Map<K, V> overflowEntriesDescending;
private SmallSortedMap() {

Loading…
Cancel
Save