aboutsummaryrefslogtreecommitdiffstats
path: root/testing/async-profiler/thread-smoke-test_should_do_some_real_work.patch
blob: 3f0e4e83aafb6fca06229b0a3716694f96e99fce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
diff --git a/test/ThreadsTarget.java b/test/ThreadsTarget.java
index cc6289c..89b2ba9 100644
--- a/test/ThreadsTarget.java
+++ b/test/ThreadsTarget.java
@@ -1,3 +1,5 @@
+import java.math.BigInteger;
+
 public class ThreadsTarget {
     public static void main(String[] args) {
         new Thread(new Runnable() {
@@ -17,17 +19,17 @@ public class ThreadsTarget {
 
     static void methodForThreadEarlyEnd() {
         long now = System.currentTimeMillis();
-        long counter = 0;
+        BigInteger counter = BigInteger.ZERO;
         while (System.currentTimeMillis() - now < 300) {
-            counter++;
+            counter = counter.nextProbablePrime();
         }
     }
 
     static void methodForRenamedThread() {
         long now = System.currentTimeMillis();
-        long counter = 0;
+        BigInteger counter = BigInteger.ZERO;
         while (System.currentTimeMillis() - now < 1000) {
-            counter++;
+            counter = counter.nextProbablePrime();
         }
     }
 }