summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-12-15 13:57:33 +0100
committerGitHub <noreply@github.com>2020-12-15 13:57:33 +0100
commitc950de2423c6e1d5a7f9b86c8b5047add1526bcc (patch)
treeecce9de58307c793ef8ff2b11ff822189e42f550 /vespalib
parente048f9f80ef02ff942cf808d9590395e1aa8c91b (diff)
parentf31f8dffef680bef44e56d2c5e22900533ab272f (diff)
Merge pull request #15816 from vespa-engine/geirst/executor-threading-service-explorer
Add explorer for the ExecutorThreadingService used in a document data…
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/util/threadexecutor.h5
-rw-r--r--vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp7
-rw-r--r--vespalib/src/vespa/vespalib/util/threadstackexecutorbase.h2
3 files changed, 14 insertions, 0 deletions
diff --git a/vespalib/src/vespa/vespalib/util/threadexecutor.h b/vespalib/src/vespa/vespalib/util/threadexecutor.h
index 61a5d9d5ac7..7d06007d7be 100644
--- a/vespalib/src/vespa/vespalib/util/threadexecutor.h
+++ b/vespalib/src/vespa/vespalib/util/threadexecutor.h
@@ -32,6 +32,11 @@ public:
* Sets a new upper limit for accepted number of tasks.
*/
virtual void setTaskLimit(uint32_t taskLimit) = 0;
+
+ /**
+ * Gets the limit for accepted number of tasks.
+ */
+ virtual uint32_t getTaskLimit() const = 0;
};
/**
diff --git a/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp b/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp
index 28ee2da2d8c..01546b80d66 100644
--- a/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp
+++ b/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp
@@ -174,6 +174,13 @@ ThreadStackExecutorBase::setTaskLimit(uint32_t taskLimit)
internalSetTaskLimit(taskLimit);
}
+uint32_t
+ThreadStackExecutorBase::getTaskLimit() const
+{
+ unique_lock guard(_lock);
+ return _taskLimit;
+}
+
void
ThreadStackExecutorBase::wakeup() {
// Nothing to do here as workers are always attentive.
diff --git a/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.h b/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.h
index c86597ca153..c0653c19516 100644
--- a/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.h
+++ b/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.h
@@ -211,6 +211,8 @@ public:
size_t getNumThreads() const override;
void setTaskLimit(uint32_t taskLimit) override;
+ uint32_t getTaskLimit() const override;
+
void wakeup() override;
/**