From 576ea1ff88f70b72ee56f40606998ba80032c2d7 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Mon, 29 Nov 2021 14:24:52 +0000 Subject: Hide sync implementation. --- searchcore/src/vespa/searchcore/proton/server/proton.cpp | 6 +----- .../searchcore/proton/server/shared_threading_service.cpp | 11 +++++++++++ .../vespa/searchcore/proton/server/shared_threading_service.h | 4 ++-- 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 shared_raw() { return _shared; } + void sync_all_executors(); vespalib::ThreadExecutor& warmup() override { return _warmup; } vespalib::ThreadExecutor& shared() override { return *_shared; } -- cgit v1.2.3