diff options
author | Sven Gothel <[email protected]> | 2023-03-07 01:16:30 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-07 01:16:30 +0100 |
commit | 6545ab42048dfda5f6cb72ce272a331078cd200e (patch) | |
tree | 920b02fb4b62df0c4780c6f685ba9ae07b6bc192 /src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java | |
parent | 1842451b0e49ac1899ed3ab3515021a6077aff92 (diff) |
Clock: Use Clock.currentNanos() instead of System.nanoTime()
Diffstat (limited to 'src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java')
-rw-r--r-- | src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java | 10 |
1 files changed, 8 insertions, 2 deletions
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) { |