diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2018-07-20 11:18:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-20 11:18:30 +0200 |
commit | 2f7f5678fb8e21e99b4d5ceeb64da4fcb4300260 (patch) | |
tree | b7eec9cf4106dd97e765496ff51d4733cf8d0a74 /searchlib | |
parent | 0e61d8895b651ca54d3ebb062c021927fa2c1532 (diff) | |
parent | bf079e641e6bb6bdd854b75c1cb621b201baba50 (diff) |
Merge pull request #6437 from vespa-engine/balder/ensure-that-there-is-at-least-1-valid-stopsign-visible-at-all-times
There must always be a stopsign visible to any concurrent reader no m…
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/common/bitvector.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/searchlib/src/vespa/searchlib/common/bitvector.h b/searchlib/src/vespa/searchlib/common/bitvector.h index fa8ec5b5cdd..298528d0846 100644 --- a/searchlib/src/vespa/searchlib/common/bitvector.h +++ b/searchlib/src/vespa/searchlib/common/bitvector.h @@ -120,9 +120,12 @@ public: } void setSize(Index sz) { - clearBit(size()); + setBit(sz); // Need to place the new stop sign first + if (sz > _sz) { + // Can only remove the old stopsign if it is ahead of the new. + clearBit(_sz); + } _sz = sz; - setBit(size()); } void setBit(Index idx) { _words[wordNum(idx)] |= mask(idx); |