activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From franz1981 <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #1515: ARTEMIS-1393 CriticalAnalyzer timeout u...
Date Thu, 07 Sep 2017 12:50:41 GMT
Github user franz1981 commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1515#discussion_r137529106
  
    --- Diff: artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalMeasure.java
---
    @@ -17,36 +17,48 @@
     
     package org.apache.activemq.artemis.utils.critical;
     
    -import org.jboss.logging.Logger;
    +import java.util.concurrent.atomic.AtomicLongFieldUpdater;
     
     public class CriticalMeasure {
     
    -   private static final Logger logger = Logger.getLogger(CriticalMeasure.class);
    +   //uses updaters to avoid creates many AtomicLong instances
    +   private static final AtomicLongFieldUpdater<CriticalMeasure> TIME_ENTER_UPDATER
= AtomicLongFieldUpdater.newUpdater(CriticalMeasure.class, "timeEnter");
    +   private static final AtomicLongFieldUpdater<CriticalMeasure> TIME_LEFT_UPDATER
= AtomicLongFieldUpdater.newUpdater(CriticalMeasure.class, "timeLeft");
     
        private volatile long timeEnter;
    --- End diff --
    
    this one: https://github.com/apache/activemq-artemis/pull/1518
    I wasn't aware about this behaviour of System::nanoTime: having received a good review
has helped me to dig into it and find it :+1: 


---

Mime
View raw message