diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-11-29 14:24:52 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-11-29 14:24:52 +0000 |
commit | 576ea1ff88f70b72ee56f40606998ba80032c2d7 (patch) | |
tree | 9638347a73cdb8d6c6bcabc474b67096633462d2 | |
parent | f6fa70762c019da2a03326dcc8f53709883b5add (diff) |
Hide sync implementation.
3 files changed, 14 insertions, 7 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index 89940fbf367..7a8c03624a6 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -447,11 +447,7 @@ Proton::~Proton() _flushEngine->close(); } if (_shared_service) { - _shared_service->warmup_raw().sync(); - _shared_service->shared_raw()->sync(); - if (_shared_service->field_writer()) { - _shared_service->field_writer()->sync_all(); - } + _shared_service->sync_all_executors(); } if ( ! _documentDBMap.empty()) { diff --git a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp index f9333aa18a5..c4fc79c43fd 100644 --- a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp @@ -31,4 +31,15 @@ SharedThreadingService::SharedThreadingService(const SharedThreadingServiceConfi } } +SharedThreadingService::~SharedThreadingService() = default; + +void +SharedThreadingService::sync_all_executors() { + _warmup.sync(); + _shared->sync(); + if (_field_writer) { + _field_writer->sync_all(); + } +} + } diff --git a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h index 12686e4a3c5..b4d3890e3e0 100644 --- a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h +++ b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h @@ -20,9 +20,9 @@ private: public: SharedThreadingService(const SharedThreadingServiceConfig& cfg); + ~SharedThreadingService(); - vespalib::SyncableThreadExecutor& warmup_raw() { return _warmup; } - std::shared_ptr<vespalib::SyncableThreadExecutor> shared_raw() { return _shared; } + void sync_all_executors(); vespalib::ThreadExecutor& warmup() override { return _warmup; } vespalib::ThreadExecutor& shared() override { return *_shared; } |