diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-03-02 08:21:25 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-03-02 08:21:25 +0000 |
commit | 8ccbd239b2e78644ebfdff8d425f42b9990b6412 (patch) | |
tree | 8db49351614eec5c512586fda975e8b771e048fe /vespalib | |
parent | 22e19a3d5dae693f36f62a2b35fab9ef0f99581c (diff) |
Since we schedule the last chunk for commit in triggerSyncNow, we can assert that we will be fully synced on the next pull when it happens in the singleCommitter thread.
That allows for further simplification.
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/util/destructor_callbacks.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vespalib/src/vespa/vespalib/util/destructor_callbacks.h b/vespalib/src/vespa/vespalib/util/destructor_callbacks.h index 7fc15e0185e..7452d72ea44 100644 --- a/vespalib/src/vespa/vespalib/util/destructor_callbacks.h +++ b/vespalib/src/vespa/vespalib/util/destructor_callbacks.h @@ -44,10 +44,17 @@ private: template<class FunctionType> std::shared_ptr<IDestructorCallback> -makeLambdaCallback(FunctionType &&function) { +makeSharedLambdaCallback(FunctionType &&function) { return std::make_shared<LambdaCallback<std::decay_t<FunctionType>>> (std::forward<FunctionType>(function)); } +template<class FunctionType> +std::unique_ptr<IDestructorCallback> +makeUniqueLambdaCallback(FunctionType &&function) { + return std::make_unique<LambdaCallback<std::decay_t<FunctionType>>> + (std::forward<FunctionType>(function)); +} + } |