aboutsummaryrefslogtreecommitdiffstats
path: root/staging_vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-12-03 16:53:56 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2021-12-03 16:53:56 +0000
commit364461704e380145f300d0339bd21df102200127 (patch)
tree1f832ae687bf9f8c6745cf28494c099d97aa901d /staging_vespalib
parent6424ef0812135cee72ebf4f6c348ed20ad640fdb (diff)
Only issue wakeup if there is a good reason too.
Diffstat (limited to 'staging_vespalib')
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/singleexecutor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/util/singleexecutor.cpp b/staging_vespalib/src/vespa/vespalib/util/singleexecutor.cpp
index b25bc1a6377..a2962c6ea84 100644
--- a/staging_vespalib/src/vespa/vespalib/util/singleexecutor.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/singleexecutor.cpp
@@ -89,7 +89,9 @@ SingleExecutor::drain(Lock & lock) {
void
SingleExecutor::wakeup() {
- _consumerCondition.notify_one();
+ if (numTasks() > 0) {
+ _consumerCondition.notify_one();
+ }
}
SingleExecutor &