diff options
-rw-r--r-- | fnet/src/tests/scheduling/schedule.cpp | 2 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/scheduler.cpp | 2 | ||||
-rw-r--r-- | jrt/src/com/yahoo/jrt/Scheduler.java | 2 | ||||
-rw-r--r-- | jrt/tests/com/yahoo/jrt/SchedulerTest.java | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/fnet/src/tests/scheduling/schedule.cpp b/fnet/src/tests/scheduling/schedule.cpp index b563c7057ff..4ae4a2e07de 100644 --- a/fnet/src/tests/scheduling/schedule.cpp +++ b/fnet/src/tests/scheduling/schedule.cpp @@ -32,7 +32,7 @@ public: if (b < a) return false; - if ((b - a) > (2 * FNET_Scheduler::SLOT_TICK)) + if ((b - a) > (3 * FNET_Scheduler::SLOT_TICK)) return false; return true; diff --git a/fnet/src/vespa/fnet/scheduler.cpp b/fnet/src/vespa/fnet/scheduler.cpp index d9229cd4843..4569aaf61c4 100644 --- a/fnet/src/vespa/fnet/scheduler.cpp +++ b/fnet/src/vespa/fnet/scheduler.cpp @@ -69,7 +69,7 @@ FNET_Scheduler::~FNET_Scheduler() void FNET_Scheduler::Schedule(FNET_Task *task, double seconds) { - uint32_t ticks = 1 + (uint32_t) std::ceil(seconds * (1000.0 / SLOT_TICK)); + uint32_t ticks = 2 + (uint32_t) std::ceil(seconds * (1000.0 / SLOT_TICK)); std::lock_guard<std::mutex> guard(_lock); if (!task->_killed) { diff --git a/jrt/src/com/yahoo/jrt/Scheduler.java b/jrt/src/com/yahoo/jrt/Scheduler.java index ae5a827076e..4e81b79117d 100644 --- a/jrt/src/com/yahoo/jrt/Scheduler.java +++ b/jrt/src/com/yahoo/jrt/Scheduler.java @@ -61,7 +61,7 @@ class Scheduler { if (seconds < 0.0) { throw new IllegalArgumentException("cannot schedule a Task in the past"); } - int ticks = 1 + (int) Math.ceil(seconds * (1000.0 / TICK)); + int ticks = 2 + (int) Math.ceil(seconds * (1000.0 / TICK)); if (isActive(task)) { linkOut(task); } diff --git a/jrt/tests/com/yahoo/jrt/SchedulerTest.java b/jrt/tests/com/yahoo/jrt/SchedulerTest.java index 1429dd5e779..2f5085842a8 100644 --- a/jrt/tests/com/yahoo/jrt/SchedulerTest.java +++ b/jrt/tests/com/yahoo/jrt/SchedulerTest.java @@ -50,8 +50,8 @@ public class SchedulerTest { if (actual < target) { return false; } - // 2 * Scheduler.TICK == 200 - return ((actual - target) <= 200); + // 3 * Scheduler.TICK == 300 + return ((actual - target) <= 300); } public void run() { |