diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-05 05:06:04 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-05 05:06:04 -0800 |
commit | 1cfdd7f98bf1a33e7edc6cfb646ee53d5654c7f4 (patch) | |
tree | 7c0ee79fb2262a09215d685bd45248329c999ed9 /documentapi/src | |
parent | e147ee77edcc9122e17adaa6b7f8a546154a8c27 (diff) | |
parent | bbe03f51a82881e0c398aff3ea2d6613a984961f (diff) |
Merge pull request #11506 from vespa-engine/balder/FastOS_Thread_Sleep-removal-rebased-1
FastOS_THread::Sleep -> std::chrono::sleep_for
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++; } |