diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-03 14:24:41 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-04 18:15:16 +0000 |
commit | 8946dbea418f760e4f0a5cbe2eb2bcbcddd25032 (patch) | |
tree | fc254ea5dea29ddf6a395b8bcdcb8c7540d22238 /documentapi/src | |
parent | 7700f411ea6f4a3e7c0599fae239ec84c18c0038 (diff) |
FastOS_THread::Sleep -> std::chrono::sleep_for
Renamed Timer -> ScheduledExecutor.
Do not include thread.h when not needed in header files.
Diffstat (limited to 'documentapi/src')
3 files changed, 9 insertions, 6 deletions
diff --git a/documentapi/src/tests/policies/policies_test.cpp b/documentapi/src/tests/policies/policies_test.cpp index 93c5d51fef5..0c3a39186a7 100644 --- a/documentapi/src/tests/policies/policies_test.cpp +++ b/documentapi/src/tests/policies/policies_test.cpp @@ -284,7 +284,7 @@ Test::assertMirrorReady(const slobrok::api::IMirrorAPI &mirror) if (mirror.ready()) { return; } - FastOS_Thread::Sleep(10); + std::this_thread::sleep_for(10ms); } ASSERT_TRUE(false); } @@ -297,7 +297,7 @@ Test::assertMirrorContains(const slobrok::api::IMirrorAPI &mirror, const string if (mirror.lookup(pattern).size() == numEntries) { return; } - FastOS_Thread::Sleep(10); + std::this_thread::sleep_for(10ms); } ASSERT_TRUE(false); } diff --git a/documentapi/src/tests/policies/testframe.cpp b/documentapi/src/tests/policies/testframe.cpp index 4cdc5d4ba14..1ca449816d9 100644 --- a/documentapi/src/tests/policies/testframe.cpp +++ b/documentapi/src/tests/policies/testframe.cpp @@ -8,6 +8,8 @@ #include <vespa/messagebus/testlib/simpleprotocol.h> #include <vespa/messagebus/testlib/simplereply.h> #include <vespa/messagebus/network/rpcnetworkparams.h> +#include <vespa/vespalib/util/time.h> +#include <thread> #include <vespa/log/log.h> LOG_SETUP(".testframe"); @@ -297,7 +299,7 @@ TestFrame::waitSlobrok(const string &pattern, uint32_t cnt) if (res.size() == cnt) { return true; } - FastOS_Thread::Sleep(10); + std::this_thread::sleep_for(10ms); } LOG(error, "Slobrok failed to resolve '%s' to %d recipients in time.", pattern.c_str(), cnt); return false; diff --git a/documentapi/src/vespa/documentapi/messagebus/policies/externslobrokpolicy.cpp b/documentapi/src/vespa/documentapi/messagebus/policies/externslobrokpolicy.cpp index 18dd525b066..e82a184d8b2 100644 --- a/documentapi/src/vespa/documentapi/messagebus/policies/externslobrokpolicy.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/policies/externslobrokpolicy.cpp @@ -1,12 +1,13 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "externslobrokpolicy.h" -#include <vespa/vespalib/text/stringtokenizer.h> #include <vespa/messagebus/routing/routingcontext.h> +#include <vespa/vespalib/text/stringtokenizer.h> +#include <vespa/vespalib/util/time.h> #include <vespa/fnet/frt/frt.h> #include <vespa/slobrok/sbmirror.h> #include <vespa/fnet/transport.h> -#include <vespa/fastos/thread.h> +#include <thread> using slobrok::api::IMirrorAPI; using slobrok::api::MirrorAPI; @@ -82,7 +83,7 @@ ExternSlobrokPolicy::lookup(mbus::RoutingContext& context, const string& pattern if (_firstTry) { int count = 0; while (entries.empty() && count < 100) { - FastOS_Thread::Sleep(50); + std::this_thread::sleep_for(50ms); entries = mirror.lookup(pattern); count++; } |