mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

gbellato
09.10.2007 3222fbb768b7202533882ac5354aa2c564831616
Use AtomicInteger instead of synchronized blocks in one case when
incrementing a monitor counter.

Issue 1136.

A unit test is already covering this part of the code.
1 files modified
10 ■■■■■ changed files
opends/src/server/org/opends/server/synchronization/plugin/SynchronizationDomain.java 10 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/synchronization/plugin/SynchronizationDomain.java
@@ -40,6 +40,7 @@
import java.util.List;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.zip.DataFormatException;
import org.opends.server.api.ConfigurableComponent;
@@ -112,7 +113,7 @@
    new TreeMap<ChangeNumber, UpdateMessage>();
  private int numRcvdUpdates = 0;
  private int numSentUpdates = 0;
  private int numProcessedUpdates = 0;
  private AtomicInteger numProcessedUpdates = new AtomicInteger();
  private int debugCount = 0;
  private PersistentServerState state;
  private int numReplayedPostOpCalled = 0;
@@ -921,10 +922,7 @@
   */
  public void incProcessedUpdates()
  {
    synchronized (this)
    {
      numProcessedUpdates++;
    }
    numProcessedUpdates.incrementAndGet();
  }
  /**
@@ -934,7 +932,7 @@
   */
  public int getNumProcessedUpdates()
  {
    return numProcessedUpdates;
    return numProcessedUpdates.get();
  }
  /**