File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
affinity/src/main/java/net/openhft/affinity Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public class MicroJitterSampler {
3434 };
3535 private static final double UTIL = Double .parseDouble (System .getProperty ("util" , "50" ));
3636 private static final boolean BUSYWAIT = Boolean .parseBoolean (System .getProperty ("busywait" , "false" ));
37- private static final int CPU = Integer . parseInt ( System .getProperty ("cpu" , "-1" ) );
37+ private static final String CPU = System .getProperty ("cpu" , "none" );
3838
3939 private final int [] count = new int [DELAY .length ];
4040 private long totalTime = 0 ;
@@ -71,10 +71,7 @@ private void once() throws InterruptedException {
7171 }
7272
7373 public void run () {
74- if (CPU != -1 )
75- Affinity .setAffinity (CPU );
76-
77- try {
74+ try (final AffinityLock lock = AffinityLock .acquireLock (CPU )) {
7875 boolean first = true ;
7976 System .out .println ("Warming up..." );
8077 while (!Thread .currentThread ().isInterrupted ()) {
You can’t perform that action at this time.
0 commit comments