summaryrefslogtreecommitdiffstats
path: root/fnet
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2019-07-01 17:33:43 +0000
committerHåvard Pettersen <havardpe@oath.com>2019-07-01 17:33:43 +0000
commitf3bf2f5b1a8b1dd1c244bb0df2d0c652959b557f (patch)
tree417bbdb86bfe09c69dc219d1c62779771b397ab5 /fnet
parentb6241e25aaefb59ee9b0251ce7284175fe647592 (diff)
use upper bound for current time estimate
Diffstat (limited to 'fnet')
-rw-r--r--fnet/src/tests/scheduling/schedule.cpp2
-rw-r--r--fnet/src/vespa/fnet/scheduler.cpp2
2 files changed, 2 insertions, 2 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) {