mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Reduce Thread.sleep to Jvm.pause, delays >= 1s to 500 ms, and remove "throws Exception" from tests
This commit is contained in:
@@ -151,7 +151,7 @@ public class ProcessInstanceLimiter implements Runnable {
|
||||
|
||||
public static void main(String[] args) throws IOException, InterruptedException {
|
||||
ProcessInstanceLimiter.limitTo(2);
|
||||
Thread.sleep(60L * 1000L);
|
||||
Jvm.pause(60L * 1000L);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -224,7 +224,7 @@ public class ProcessInstanceLimiter implements Runnable {
|
||||
long elapsedTime;
|
||||
while ((elapsedTime = System.currentTimeMillis() - start) < pause) {
|
||||
try {
|
||||
Thread.sleep(pause - elapsedTime);
|
||||
Jvm.pause(pause - elapsedTime);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
}
|
||||
@@ -336,7 +336,7 @@ public class ProcessInstanceLimiter implements Runnable {
|
||||
this.callback.tooManyProcessesOfType(processType);
|
||||
return;
|
||||
}
|
||||
//try {Thread.sleep(60L*1000L);} catch (InterruptedException e) {}
|
||||
//try {Jvm.pause(60L*1000L);} catch (InterruptedException e) {}
|
||||
//we've got the lock, now copy the array
|
||||
try {
|
||||
for (int i = 0; i < times1.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user