aboutsummaryrefslogtreecommitdiffstats
path: root/staging_vespalib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2021-10-28 21:03:14 +0200
committerTor Egge <Tor.Egge@online.no>2021-10-28 21:03:14 +0200
commit85115fc4804effd03d89c229be30d13a9d6471c5 (patch)
treecd28081347dda032c7d5e8ee2716f0974e9db5cc /staging_vespalib
parent13472dff416a84e4295cf11e618ab17e97a59f82 (diff)
Rename ISequencedTaskExecutor::sync() to sync_all().
Diffstat (limited to 'staging_vespalib')
-rw-r--r--staging_vespalib/src/tests/sequencedtaskexecutor/adaptive_sequenced_executor_test.cpp16
-rw-r--r--staging_vespalib/src/tests/sequencedtaskexecutor/foregroundtaskexecutor_test.cpp6
-rw-r--r--staging_vespalib/src/tests/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp16
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.cpp4
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.h2
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/foregroundtaskexecutor.cpp2
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/foregroundtaskexecutor.h2
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/isequencedtaskexecutor.h8
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutor.cpp4
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutor.h2
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutorobserver.cpp4
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutorobserver.h2
12 files changed, 34 insertions, 34 deletions
diff --git a/staging_vespalib/src/tests/sequencedtaskexecutor/adaptive_sequenced_executor_test.cpp b/staging_vespalib/src/tests/sequencedtaskexecutor/adaptive_sequenced_executor_test.cpp
index 5c188c3204c..5fc6d2a69ae 100644
--- a/staging_vespalib/src/tests/sequencedtaskexecutor/adaptive_sequenced_executor_test.cpp
+++ b/staging_vespalib/src/tests/sequencedtaskexecutor/adaptive_sequenced_executor_test.cpp
@@ -72,7 +72,7 @@ TEST_F("testExecute", Fixture) {
tv->wait(1);
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
- f._threads.sync();
+ f._threads.sync_all();
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
}
@@ -87,7 +87,7 @@ TEST_F("require that task with same component id are serialized", Fixture)
tv->wait(2);
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
- f._threads.sync();
+ f._threads.sync_all();
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
}
@@ -106,7 +106,7 @@ TEST_F("require that task with different component ids are not serialized", Fixt
}
EXPECT_EQUAL(1, tv->_fail);
EXPECT_EQUAL(14, tv->_val);
- f._threads.sync();
+ f._threads.sync_all();
EXPECT_EQUAL(1, tv->_fail);
EXPECT_EQUAL(14, tv->_val);
break;
@@ -125,7 +125,7 @@ TEST_F("require that task with same string component id are serialized", Fixture
tv->wait(2);
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
- f._threads.sync();
+ f._threads.sync_all();
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
}
@@ -146,7 +146,7 @@ int detectSerializeFailure(Fixture &f, vespalib::stringref altComponentId, int t
}
EXPECT_EQUAL(1, tv->_fail);
EXPECT_EQUAL(14, tv->_val);
- f._threads.sync();
+ f._threads.sync_all();
EXPECT_EQUAL(1, tv->_fail);
EXPECT_EQUAL(14, tv->_val);
break;
@@ -196,7 +196,7 @@ TEST_F("require that execute works with const lambda", Fixture)
{ res.push_back(i--); res.push_back(i--); };
f._threads.execute(0, lambda);
f._threads.execute(0, lambda);
- f._threads.sync();
+ f._threads.sync_all();
std::vector<int> exp({5, 4, 5, 4});
EXPECT_EQUAL(exp, res);
EXPECT_EQUAL(5, i);
@@ -211,7 +211,7 @@ TEST_F("require that execute works with reference to lambda", Fixture)
auto &lambdaref = lambda;
f._threads.execute(0, lambdaref);
f._threads.execute(0, lambdaref);
- f._threads.sync();
+ f._threads.sync_all();
std::vector<int> exp({5, 4, 5, 4});
EXPECT_EQUAL(exp, res);
EXPECT_EQUAL(5, i);
@@ -224,7 +224,7 @@ TEST_F("require that executeLambda works", Fixture)
const auto lambda = [i, &res]() mutable
{ res.push_back(i--); res.push_back(i--); };
f._threads.executeLambda(ISequencedTaskExecutor::ExecutorId(0), lambda);
- f._threads.sync();
+ f._threads.sync_all();
std::vector<int> exp({5, 4});
EXPECT_EQUAL(exp, res);
EXPECT_EQUAL(5, i);
diff --git a/staging_vespalib/src/tests/sequencedtaskexecutor/foregroundtaskexecutor_test.cpp b/staging_vespalib/src/tests/sequencedtaskexecutor/foregroundtaskexecutor_test.cpp
index ae01452c46b..56fb570209c 100644
--- a/staging_vespalib/src/tests/sequencedtaskexecutor/foregroundtaskexecutor_test.cpp
+++ b/staging_vespalib/src/tests/sequencedtaskexecutor/foregroundtaskexecutor_test.cpp
@@ -72,7 +72,7 @@ TEST_F("testExecute", Fixture) {
tv->wait(1);
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
- f._threads.sync();
+ f._threads.sync_all();
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
}
@@ -87,7 +87,7 @@ TEST_F("require that task with same id are serialized", Fixture)
tv->wait(2);
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
- f._threads.sync();
+ f._threads.sync_all();
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
}
@@ -106,7 +106,7 @@ TEST_F("require that task with different ids are serialized", Fixture)
}
EXPECT_EQUAL(1, tv->_fail);
EXPECT_EQUAL(14, tv->_val);
- f._threads.sync();
+ f._threads.sync_all();
EXPECT_EQUAL(1, tv->_fail);
EXPECT_EQUAL(14, tv->_val);
break;
diff --git a/staging_vespalib/src/tests/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp b/staging_vespalib/src/tests/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp
index 705c7174c4a..7c90f96afdd 100644
--- a/staging_vespalib/src/tests/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp
+++ b/staging_vespalib/src/tests/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp
@@ -76,7 +76,7 @@ TEST_F("testExecute", Fixture) {
tv->wait(1);
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
- f._threads->sync();
+ f._threads->sync_all();
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
}
@@ -91,7 +91,7 @@ TEST_F("require that task with same component id are serialized", Fixture)
tv->wait(2);
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
- f._threads->sync();
+ f._threads->sync_all();
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
}
@@ -110,7 +110,7 @@ TEST_F("require that task with different component ids are not serialized", Fixt
}
EXPECT_EQUAL(1, tv->_fail);
EXPECT_EQUAL(14, tv->_val);
- f._threads->sync();
+ f._threads->sync_all();
EXPECT_EQUAL(1, tv->_fail);
EXPECT_EQUAL(14, tv->_val);
break;
@@ -129,7 +129,7 @@ TEST_F("require that task with same string component id are serialized", Fixture
tv->wait(2);
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
- f._threads->sync();
+ f._threads->sync_all();
EXPECT_EQUAL(0, tv->_fail);
EXPECT_EQUAL(42, tv->_val);
}
@@ -150,7 +150,7 @@ int detectSerializeFailure(Fixture &f, vespalib::stringref altComponentId, int t
}
EXPECT_EQUAL(1, tv->_fail);
EXPECT_EQUAL(14, tv->_val);
- f._threads->sync();
+ f._threads->sync_all();
EXPECT_EQUAL(1, tv->_fail);
EXPECT_EQUAL(14, tv->_val);
break;
@@ -200,7 +200,7 @@ TEST_F("require that execute works with const lambda", Fixture)
{ res.push_back(i--); res.push_back(i--); };
f._threads->execute(0, lambda);
f._threads->execute(0, lambda);
- f._threads->sync();
+ f._threads->sync_all();
std::vector<int> exp({5, 4, 5, 4});
EXPECT_EQUAL(exp, res);
EXPECT_EQUAL(5, i);
@@ -215,7 +215,7 @@ TEST_F("require that execute works with reference to lambda", Fixture)
auto &lambdaref = lambda;
f._threads->execute(0, lambdaref);
f._threads->execute(0, lambdaref);
- f._threads->sync();
+ f._threads->sync_all();
std::vector<int> exp({5, 4, 5, 4});
EXPECT_EQUAL(exp, res);
EXPECT_EQUAL(5, i);
@@ -228,7 +228,7 @@ TEST_F("require that executeLambda works", Fixture)
const auto lambda = [i, &res]() mutable
{ res.push_back(i--); res.push_back(i--); };
f._threads->executeLambda(ISequencedTaskExecutor::ExecutorId(0), lambda);
- f._threads->sync();
+ f._threads->sync_all();
std::vector<int> exp({5, 4});
EXPECT_EQUAL(exp, res);
EXPECT_EQUAL(5, i);
diff --git a/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.cpp b/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.cpp
index 7ffa396304c..4d08e14375c 100644
--- a/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.cpp
@@ -246,7 +246,7 @@ AdaptiveSequencedExecutor::AdaptiveSequencedExecutor(size_t num_strands, size_t
AdaptiveSequencedExecutor::~AdaptiveSequencedExecutor()
{
- sync();
+ sync_all();
{
auto guard = std::unique_lock(_mutex);
assert(_self.state == Self::State::OPEN);
@@ -305,7 +305,7 @@ AdaptiveSequencedExecutor::executeTask(ExecutorId id, Task::UP task)
}
void
-AdaptiveSequencedExecutor::sync()
+AdaptiveSequencedExecutor::sync_all()
{
BarrierCompletion barrierCompletion;
{
diff --git a/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.h b/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.h
index 185345ebc9c..ccf6ab977f3 100644
--- a/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.h
+++ b/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.h
@@ -147,7 +147,7 @@ public:
~AdaptiveSequencedExecutor() override;
ExecutorId getExecutorId(uint64_t component) const override;
void executeTask(ExecutorId id, Task::UP task) override;
- void sync() override;
+ void sync_all() override;
void setTaskLimit(uint32_t task_limit) override;
ExecutorStats getStats() override;
Config get_config() const;
diff --git a/staging_vespalib/src/vespa/vespalib/util/foregroundtaskexecutor.cpp b/staging_vespalib/src/vespa/vespalib/util/foregroundtaskexecutor.cpp
index 703256c5521..ce5237f41c9 100644
--- a/staging_vespalib/src/vespa/vespalib/util/foregroundtaskexecutor.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/foregroundtaskexecutor.cpp
@@ -27,7 +27,7 @@ ForegroundTaskExecutor::executeTask(ExecutorId id, Executor::Task::UP task)
}
void
-ForegroundTaskExecutor::sync()
+ForegroundTaskExecutor::sync_all()
{
}
diff --git a/staging_vespalib/src/vespa/vespalib/util/foregroundtaskexecutor.h b/staging_vespalib/src/vespa/vespalib/util/foregroundtaskexecutor.h
index 9d351aca653..615bf62afe5 100644
--- a/staging_vespalib/src/vespa/vespalib/util/foregroundtaskexecutor.h
+++ b/staging_vespalib/src/vespa/vespalib/util/foregroundtaskexecutor.h
@@ -23,7 +23,7 @@ public:
ExecutorId getExecutorId(uint64_t componentId) const override;
void executeTask(ExecutorId id, Executor::Task::UP task) override;
- void sync() override;
+ void sync_all() override;
void setTaskLimit(uint32_t taskLimit) override;
ExecutorStats getStats() override;
private:
diff --git a/staging_vespalib/src/vespa/vespalib/util/isequencedtaskexecutor.h b/staging_vespalib/src/vespa/vespalib/util/isequencedtaskexecutor.h
index a6aca98a65d..8268363d335 100644
--- a/staging_vespalib/src/vespa/vespalib/util/isequencedtaskexecutor.h
+++ b/staging_vespalib/src/vespa/vespalib/util/isequencedtaskexecutor.h
@@ -58,7 +58,7 @@ public:
/**
* Wrap lambda function into a task and schedule it to be run.
* Caller must ensure that pointers and references are valid and
- * call sync before tearing down pointed to/referenced data.
+ * call sync_all before tearing down pointed to/referenced data.
*
* @param id which internal executor to use
* @param function function to be wrapped in a task and later executed
@@ -70,7 +70,7 @@ public:
/**
* Wait for all scheduled tasks to complete.
*/
- virtual void sync() = 0;
+ virtual void sync_all() = 0;
virtual void setTaskLimit(uint32_t taskLimit) = 0;
@@ -79,7 +79,7 @@ public:
/**
* Wrap lambda function into a task and schedule it to be run.
* Caller must ensure that pointers and references are valid and
- * call sync before tearing down pointed to/referenced data.
+ * call sync_all before tearing down pointed to/referenced data.
*
* @param componentId component id
* @param function function to be wrapped in a task and later executed
@@ -93,7 +93,7 @@ public:
/**
* Wrap lambda function into a task and schedule it to be run.
* Caller must ensure that pointers and references are valid and
- * call sync before tearing down pointed to/referenced data.
+ * call sync_all before tearing down pointed to/referenced data.
*
* @param id executor id
* @param function function to be wrapped in a task and later executed
diff --git a/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutor.cpp b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutor.cpp
index 9e95bdaa3ab..038b9201724 100644
--- a/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutor.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutor.cpp
@@ -51,7 +51,7 @@ SequencedTaskExecutor::create(vespalib::Runnable::init_fun_t func, uint32_t thre
SequencedTaskExecutor::~SequencedTaskExecutor()
{
- sync();
+ sync_all();
}
SequencedTaskExecutor::SequencedTaskExecutor(std::unique_ptr<std::vector<std::unique_ptr<vespalib::SyncableThreadExecutor>>> executors)
@@ -82,7 +82,7 @@ SequencedTaskExecutor::executeTask(ExecutorId id, vespalib::Executor::Task::UP t
}
void
-SequencedTaskExecutor::sync() {
+SequencedTaskExecutor::sync_all() {
wakeup();
for (auto &executor : *_executors) {
executor->sync();
diff --git a/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutor.h b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutor.h
index 7b49f7aac75..245d6d29780 100644
--- a/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutor.h
+++ b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutor.h
@@ -24,7 +24,7 @@ public:
void setTaskLimit(uint32_t taskLimit) override;
void executeTask(ExecutorId id, vespalib::Executor::Task::UP task) override;
ExecutorId getExecutorId(uint64_t componentId) const override;
- void sync() override;
+ void sync_all() override;
ExecutorStats getStats() override;
void wakeup() override;
diff --git a/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutorobserver.cpp b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutorobserver.cpp
index 4f4a2e6ab6d..5ae8e96b606 100644
--- a/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutorobserver.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutorobserver.cpp
@@ -28,10 +28,10 @@ SequencedTaskExecutorObserver::executeTask(ExecutorId id, vespalib::Executor::Ta
}
void
-SequencedTaskExecutorObserver::sync()
+SequencedTaskExecutorObserver::sync_all()
{
++_syncCnt;
- _executor.sync();
+ _executor.sync_all();
}
std::vector<uint32_t>
diff --git a/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutorobserver.h b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutorobserver.h
index 71717c051e7..7e2bf968952 100644
--- a/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutorobserver.h
+++ b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutorobserver.h
@@ -25,7 +25,7 @@ public:
ExecutorId getExecutorId(uint64_t componentId) const override;
void executeTask(ExecutorId id, vespalib::Executor::Task::UP task) override;
- void sync() override;
+ void sync_all() override;
void setTaskLimit(uint32_t taskLimit) override;
vespalib::ExecutorStats getStats() override;