aboutsummaryrefslogtreecommitdiffstats
path: root/searchcorespi
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2021-11-26 11:39:31 +0100
committerGitHub <noreply@github.com>2021-11-26 11:39:31 +0100
commit5beee2e405aa25594e454adcd6ac7228c0b450c4 (patch)
tree5511b128d726cdaced6417b983eb73b26267f56a /searchcorespi
parent64c7a89cf55017a3517f4399e0226b84b2926bf4 (diff)
parenta7d737bb813c4398ad226b893117093b6f72a148 (diff)
Merge pull request #20235 from vespa-engine/balder/only-master-need-sync
Only expose sync for the master thread.
Diffstat (limited to 'searchcorespi')
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/i_thread_service.h5
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/searchcorespi/src/vespa/searchcorespi/index/i_thread_service.h b/searchcorespi/src/vespa/searchcorespi/index/i_thread_service.h
index b4e51e2dd1b..f973908b62d 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/i_thread_service.h
+++ b/searchcorespi/src/vespa/searchcorespi/index/i_thread_service.h
@@ -9,7 +9,7 @@ namespace searchcorespi::index {
/**
* Interface for a single thread used for write tasks.
*/
-struct IThreadService : public vespalib::SyncableThreadExecutor
+struct IThreadService : public vespalib::ThreadExecutor
{
IThreadService(const IThreadService &) = delete;
IThreadService & operator = (const IThreadService &) = delete;
@@ -25,6 +25,9 @@ struct IThreadService : public vespalib::SyncableThreadExecutor
* Returns whether the current thread is the underlying thread.
*/
virtual bool isCurrentThread() const = 0;
+};
+
+struct ISyncableThreadService : public IThreadService, vespalib::Syncable {
};
diff --git a/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h b/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h
index 72362688659..c95a42f601b 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h
+++ b/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h
@@ -69,7 +69,7 @@ struct IThreadingService
*/
virtual void blocking_master_execute(vespalib::Executor::Task::UP task) = 0;
- virtual IThreadService &master() = 0;
+ virtual ISyncableThreadService &master() = 0;
virtual IThreadService &index() = 0;
virtual vespalib::ThreadExecutor &summary() = 0;
virtual vespalib::ThreadExecutor &shared() = 0;