diff options
author | Geir Storli <geirst@yahoo-inc.com> | 2017-03-09 15:26:32 +0000 |
---|---|---|
committer | Geir Storli <geirst@yahoo-inc.com> | 2017-03-09 15:26:32 +0000 |
commit | 782b2a6c2e6bfa67d49d449cdde59a8bcfa20a64 (patch) | |
tree | 2ee1ce53d679699feade6b9432b906a92d7a58b9 /searchcore/src/tests/proton/attribute/imported_attributes_context | |
parent | 25014e1d214f41fe4de3e2d42ef6a92bf4afa6f8 (diff) |
Use std::async instead of explicit std::thread.
Diffstat (limited to 'searchcore/src/tests/proton/attribute/imported_attributes_context')
-rw-r--r-- | searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp b/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp index 6f6ef33e4f2..eafe4f00639 100644 --- a/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp +++ b/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp @@ -9,7 +9,7 @@ LOG_SETUP("imported_attributes_context_test"); #include <vespa/searchlib/attribute/attribute.h> #include <vespa/searchlib/attribute/attributefactory.h> #include <vespa/searchlib/attribute/imported_attribute_vector.h> -#include <thread> +#include <future> using namespace proton; using search::AttributeVector; @@ -42,10 +42,7 @@ addDoc(AttributeVector &attr) bool hasActiveEnumGuards(AttributeVector &attr) { - bool result; - std::thread thread([&result,&attr]() { result = attr.hasActiveEnumGuards(); }); - thread.join(); - return result; + return std::async(std::launch::async, [&attr] { return attr.hasActiveEnumGuards(); }).get(); } void |