diff options
author | Tor Egge <Tor.Egge@oath.com> | 2017-10-31 09:36:55 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2017-10-31 09:36:55 +0000 |
commit | 1179d3c49520a3763ae0acc97cf662b027c0ace4 (patch) | |
tree | 23d0cdda74281ce841151b3b14543ca4e80cea32 /searchlib | |
parent | cfede8e29baba06d2bb8fbf456df826e1a2d06db (diff) |
Use std::promise<void> instead of std::promise<bool> when value is ignored.
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/common/threaded_compactable_lid_space.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/searchlib/src/vespa/searchlib/common/threaded_compactable_lid_space.cpp b/searchlib/src/vespa/searchlib/common/threaded_compactable_lid_space.cpp index 531d7be38cc..079a1f493de 100644 --- a/searchlib/src/vespa/searchlib/common/threaded_compactable_lid_space.cpp +++ b/searchlib/src/vespa/searchlib/common/threaded_compactable_lid_space.cpp @@ -23,10 +23,10 @@ ThreadedCompactableLidSpace::~ThreadedCompactableLidSpace() void ThreadedCompactableLidSpace::compactLidSpace(uint32_t wantedDocLidLimit) { - std::promise<bool> promise; - std::future<bool> future = promise.get_future(); - _executor.executeLambda(_executorId, [this, wantedDocLidLimit, &promise]() { _target->compactLidSpace(wantedDocLidLimit); promise.set_value(true); }); - (void) future.get(); + std::promise<void> promise; + auto future = promise.get_future(); + _executor.executeLambda(_executorId, [this, wantedDocLidLimit, &promise]() { _target->compactLidSpace(wantedDocLidLimit); promise.set_value(); }); + future.wait(); } bool @@ -44,10 +44,10 @@ ThreadedCompactableLidSpace::getEstimatedShrinkLidSpaceGain() const void ThreadedCompactableLidSpace::shrinkLidSpace() { - std::promise<bool> promise; - std::future<bool> future = promise.get_future(); - _executor.executeLambda(_executorId, [this, &promise]() { _target->shrinkLidSpace(); promise.set_value(true); }); - (void) future.get(); + std::promise<void> promise; + auto future = promise.get_future(); + _executor.executeLambda(_executorId, [this, &promise]() { _target->shrinkLidSpace(); promise.set_value(); }); + future.wait(); } } |