Commit be666b60 authored by Tuukka Lehtonen's avatar Tuukka Lehtonen
Browse files

Replace use of scheduleAtFixedRate with scheduleWithFixedDelay

gitlab #711
parent 8a4a02eb
......@@ -44,7 +44,7 @@ public class DiskWarningSystem {
public DiskWarningSystem(int amount, TimeUnit unit) {
future = Simantics.scheduleAtFixedRate(new Runnable() {
future = Simantics.scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
......
......@@ -53,7 +53,7 @@ public class MemoryWarningSystem {
// }
// }, null, null);
future = Simantics.scheduleAtFixedRate(new Runnable() {
future = Simantics.scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
......
......@@ -210,6 +210,10 @@ public class Simantics {
return ThreadUtils.getTimer().scheduleAtFixedRate(runnable, initialDelay, period, unit);
}
public static ScheduledFuture<?> scheduleWithFixedDelay(Runnable runnable, int initialDelay, int period, TimeUnit unit) {
return ThreadUtils.getTimer().scheduleWithFixedDelay(runnable, initialDelay, period, unit);
}
/**
* Queue execution of a non-blocking runnable. Use this method with caution.
* A non-blocking runnable nevers locks anything, No Locks, No semaphores,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment