summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-06-03 10:13:12 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-06-03 10:13:12 +0000
commit97e6990f31f018ca98d77d27384f60cc6fc30b79 (patch)
tree3d0d02cf2374f5b407fb6e869248c61a006c461b /searchlib
parent4babc05819a7bdf06a1082e238ad0751fbeacf0e (diff)
Ensure sequential consistency.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/common/allocatedbitvector.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/searchlib/src/vespa/searchlib/common/allocatedbitvector.cpp b/searchlib/src/vespa/searchlib/common/allocatedbitvector.cpp
index 46ed6f3cdf4..659e3718a13 100644
--- a/searchlib/src/vespa/searchlib/common/allocatedbitvector.cpp
+++ b/searchlib/src/vespa/searchlib/common/allocatedbitvector.cpp
@@ -32,6 +32,7 @@ extract_size_capacity(const AllocatedBitVector & bv) {
while (capacity < size) {
// Since size and capacity might be changed in another thread we need
// this fallback to avoid inconsistency during shrink.
+ std::atomic_thread_fence(std::memory_order_seq_cst);
size = bv.size();
capacity = bv.capacity();
}