summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/singleexecutor.cpp2
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/singleexecutor.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/util/singleexecutor.cpp b/staging_vespalib/src/vespa/vespalib/util/singleexecutor.cpp
index bf1c41350ee..791b0876c19 100644
--- a/staging_vespalib/src/vespa/vespalib/util/singleexecutor.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/singleexecutor.cpp
@@ -96,7 +96,7 @@ SingleExecutor::run_tasks_till(uint64_t available) {
while (consumed < available) {
Task::UP task = std::move(_tasks[index(consumed)]);
task->run();
- _rp.store(++consumed, std::memory_order_relaxed);
+ _rp.store(++consumed, std::memory_order_release);
if (wakeupLimit == consumed) {
MonitorGuard guard(_producerMonitor);
guard.broadcast();
diff --git a/staging_vespalib/src/vespa/vespalib/util/singleexecutor.h b/staging_vespalib/src/vespa/vespalib/util/singleexecutor.h
index 5bf7ef9fe6f..0ab89355566 100644
--- a/staging_vespalib/src/vespa/vespalib/util/singleexecutor.h
+++ b/staging_vespalib/src/vespa/vespalib/util/singleexecutor.h
@@ -36,7 +36,7 @@ private:
}
uint64_t numTasks() const {
- return _wp.load(std::memory_order_relaxed) - _rp.load(std::memory_order_relaxed);
+ return _wp.load(std::memory_order_relaxed) - _rp.load(std::memory_order_acquire);
}
std::atomic<uint32_t> _taskLimit;
std::atomic<uint32_t> _wantedTaskLimit;