From 6545ab42048dfda5f6cb72ce272a331078cd200e Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Tue, 7 Mar 2023 01:16:30 +0100
Subject: Clock: Use Clock.currentNanos() instead of System.nanoTime()

---
 .../com/jogamp/common/util/locks/TestRecursiveLock01.java      | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java')

diff --git a/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java b/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java
index e5456f4..e119569 100644
--- a/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java
+++ b/src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java
@@ -37,6 +37,7 @@ import java.util.Map;
 import org.junit.Assert;
 import org.junit.Test;
 
+import com.jogamp.common.os.Clock;
 import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.InterruptSource;
 import com.jogamp.junit.util.SingletonJunitCase;
@@ -141,6 +142,7 @@ public class TestRecursiveLock01 extends SingletonJunitCase {
                 incrDeferredThreadCount();
             }
 
+            @Override
             public void run() {
                 if(DEBUG) {
                     System.err.print("[a2");
@@ -175,9 +177,9 @@ public class TestRecursiveLock01 extends SingletonJunitCase {
         }
 
         public final void lock() {
-            long td = System.nanoTime();
+            long td = Clock.currentNanos();
             locker.lock();
-            td = System.nanoTime() - td;
+            td = Clock.currentNanos() - td;
 
             final String cur = Thread.currentThread().getName();
             ThreadStat ts = threadWaitMap.get(cur);
@@ -258,14 +260,17 @@ public class TestRecursiveLock01 extends SingletonJunitCase {
             this.yieldMode = yieldMode;
         }
 
+        @Override
         public final void stop() {
             shouldStop = true;
         }
 
+        @Override
         public final boolean isStopped() {
             return stopped;
         }
 
+        @Override
         public void waitUntilStopped() {
             synchronized(this) {
                 while(!stopped) {
@@ -279,6 +284,7 @@ public class TestRecursiveLock01 extends SingletonJunitCase {
 
         }
 
+        @Override
         public void run() {
             synchronized(this) {
                 while(!shouldStop && loops>0) {
-- 
cgit v1.2.3