diff options
author | Tor Egge <Tor.Egge@oath.com> | 2018-04-20 09:15:30 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2018-04-20 09:15:30 +0000 |
commit | 0b71f5899ec4c0f2e74551daff901db36e7f4182 (patch) | |
tree | a2bc207674dceef5fc9d6c1a17ae3ecb2db6fd2c | |
parent | b438d5ef09ae94d0280e824e93196ae57ab97819 (diff) |
Remove unused AttributeEnumGuard.
4 files changed, 1 insertions, 43 deletions
diff --git a/searchlib/src/tests/attribute/guard/attributeguard.cpp b/searchlib/src/tests/attribute/guard/attributeguard.cpp index 314c5f336e0..b042806eb35 100644 --- a/searchlib/src/tests/attribute/guard/attributeguard.cpp +++ b/searchlib/src/tests/attribute/guard/attributeguard.cpp @@ -20,7 +20,7 @@ AttributeGuardTest::Main() AttributeVector::SP ssattr(new SingleStringExtAttribute("ss1")); - AttributeEnumGuard guard(ssattr); + AttributeGuard guard(ssattr); EXPECT_TRUE(guard.valid()); TEST_DONE(); diff --git a/searchlib/src/vespa/searchlib/attribute/attributeguard.cpp b/searchlib/src/vespa/searchlib/attribute/attributeguard.cpp index 3b41ca9364b..02f1eb39853 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributeguard.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributeguard.cpp @@ -16,31 +16,6 @@ AttributeGuard::AttributeGuard(const AttributeVector::SP & attr) : { } -AttributeEnumGuard::AttributeEnumGuard(const AttributeVector::SP & attr) : - AttributeGuard(attr), - _lock() -{ - takeLock(); -} - -AttributeEnumGuard::AttributeEnumGuard(const AttributeGuard & attr) : - AttributeGuard(attr), - _lock() -{ - takeLock(); -} - -AttributeEnumGuard::~AttributeEnumGuard() { } - -void AttributeEnumGuard::takeLock() { - if (valid()) { - std::shared_lock<std::shared_timed_mutex> take(get()->getEnumLock(), - std::defer_lock); - _lock = std::move(take); - _lock.lock(); - } -} - template class ComponentGuard<AttributeVector>; } diff --git a/searchlib/src/vespa/searchlib/attribute/attributeguard.h b/searchlib/src/vespa/searchlib/attribute/attributeguard.h index ea389f8dda7..09538b75334 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributeguard.h +++ b/searchlib/src/vespa/searchlib/attribute/attributeguard.h @@ -23,21 +23,5 @@ public: AttributeGuard(const AttributeVectorSP & attribute); }; -/** - * This class makes sure that the attribute vector is not updated with enum changes while the guard is held. - **/ -class AttributeEnumGuard : public AttributeGuard -{ -public: - AttributeEnumGuard(const AttributeEnumGuard &) = delete; - AttributeEnumGuard & operator = (const AttributeEnumGuard &) = delete; - explicit AttributeEnumGuard(const AttributeVectorSP & attribute); - explicit AttributeEnumGuard(const AttributeGuard & attribute); - ~AttributeEnumGuard(); -private: - mutable std::shared_lock<std::shared_timed_mutex> _lock; - void takeLock(); -}; - } diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.h b/searchlib/src/vespa/searchlib/attribute/attributevector.h index ff13a03e422..f00a8779c92 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.h +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.h @@ -631,7 +631,6 @@ private: class ReadGuard; friend class ComponentGuard<AttributeVector>; - friend class AttributeEnumGuard; friend class AttributeValueGuard; friend class AttributeTest; friend class AttributeManagerTest; |