logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpo...@apache.org
Subject svn commit: r1486296 - in /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers: CachedClock.java CoarseCachedClock.java
Date Sat, 25 May 2013 07:16:03 GMT
Author: rpopma
Date: Sat May 25 07:16:02 2013
New Revision: 1486296

URL: http://svn.apache.org/r1486296
Log:
LOG4J2-238: removed dependency on sun.misc.Unsafe from CachedClock and CoarseCachedClock to
make log4j easier to use in OSGi applications

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/CachedClock.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/CoarseCachedClock.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/CachedClock.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/CachedClock.java?rev=1486296&r1=1486295&r2=1486296&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/CachedClock.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/CachedClock.java
Sat May 25 07:16:02 2013
@@ -16,7 +16,7 @@
  */
 package org.apache.logging.log4j.core.helpers;
 
-import com.lmax.disruptor.util.Util;
+import java.util.concurrent.locks.LockSupport;
 
 /**
  * Implementation of the {@code Clock} interface that tracks the time in a
@@ -37,7 +37,8 @@ public final class CachedClock implement
             while (true) {
                 long time = System.currentTimeMillis();
                 millis = time;
-                Util.getUnsafe().park(true, time + 1); // abs (millis)
+                LockSupport.parkNanos(1000 * 1000);
+                // Util.getUnsafe().park(true, time + 1); // abs (millis)
                 // Util.getUnsafe().park(false, 1000 * 1000);// relative(nanos)
             }
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/CoarseCachedClock.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/CoarseCachedClock.java?rev=1486296&r1=1486295&r2=1486296&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/CoarseCachedClock.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/CoarseCachedClock.java
Sat May 25 07:16:02 2013
@@ -16,7 +16,7 @@
  */
 package org.apache.logging.log4j.core.helpers;
 
-import com.lmax.disruptor.util.Util;
+import java.util.concurrent.locks.LockSupport;
 
 /**
  * This Clock implementation is similar to CachedClock. It is slightly faster at
@@ -32,7 +32,8 @@ public final class CoarseCachedClock imp
             while (true) {
                 long time = System.currentTimeMillis();
                 millis = time;
-                Util.getUnsafe().park(true, time + 1); // abs (millis)
+                LockSupport.parkNanos(1000 * 1000);
+                // Util.getUnsafe().park(true, time + 1); // abs (millis)
                 // Util.getUnsafe().park(false, 1000 * 1000);// relative(nanos)
             }
         }



Mime
View raw message