summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-10-07 20:29:40 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-10-07 20:53:05 +0000
commit356172042cbc96375be8d663a945879b9f10dd41 (patch)
treee77fb1af93766b3655df04a55a9fa5dee6ef7971 /searchlib
parent379b3d8c3ce128da5a985ed73fce99326369512c (diff)
- GC unused code.
- vespalib::Lock -> std::mutex
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/docstore/compacter.h2
-rw-r--r--searchlib/src/vespa/searchlib/docstore/randreaders.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/docstore/randreaders.h2
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/memory_index.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/memory_index.h14
5 files changed, 12 insertions, 13 deletions
diff --git a/searchlib/src/vespa/searchlib/docstore/compacter.h b/searchlib/src/vespa/searchlib/docstore/compacter.h
index cf059b6cb04..52691d2c415 100644
--- a/searchlib/src/vespa/searchlib/docstore/compacter.h
+++ b/searchlib/src/vespa/searchlib/docstore/compacter.h
@@ -51,7 +51,7 @@ private:
uint64_t _writeCount;
vespalib::duration _maxBucketGuardDuration;
vespalib::steady_time _lastSample;
- vespalib::Lock _lock;
+ std::mutex _lock;
vespalib::MemoryDataStore _backingMemory;
std::vector<StoreByBucket> _tmpStore;
GenerationHandler::Guard _lidGuard;
diff --git a/searchlib/src/vespa/searchlib/docstore/randreaders.cpp b/searchlib/src/vespa/searchlib/docstore/randreaders.cpp
index 2eb419cf8eb..cb670f513f7 100644
--- a/searchlib/src/vespa/searchlib/docstore/randreaders.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/randreaders.cpp
@@ -107,7 +107,7 @@ MMapRandReadDynamic::MMapRandReadDynamic(const vespalib::string &fileName, int m
void
MMapRandReadDynamic::remap(size_t sz)
{
- vespalib::LockGuard guard(_lock);
+ std::lock_guard guard(_lock);
if ((sz > 0) && _holder.hasValue() && contains(*_holder.get(), sz)) {
return;
}
diff --git a/searchlib/src/vespa/searchlib/docstore/randreaders.h b/searchlib/src/vespa/searchlib/docstore/randreaders.h
index 4503c3600d4..00dc371bddf 100644
--- a/searchlib/src/vespa/searchlib/docstore/randreaders.h
+++ b/searchlib/src/vespa/searchlib/docstore/randreaders.h
@@ -47,7 +47,7 @@ private:
vespalib::PtrHolder<FastOS_FileInterface> _holder;
int _mmapFlags;
int _fadviseOptions;
- vespalib::Lock _lock;
+ std::mutex _lock;
};
class NormalRandRead : public FileRandRead
diff --git a/searchlib/src/vespa/searchlib/memoryindex/memory_index.cpp b/searchlib/src/vespa/searchlib/memoryindex/memory_index.cpp
index 34c5d65ab23..789b7fcf452 100644
--- a/searchlib/src/vespa/searchlib/memoryindex/memory_index.cpp
+++ b/searchlib/src/vespa/searchlib/memoryindex/memory_index.cpp
@@ -18,7 +18,6 @@ LOG_SETUP(".searchlib.memoryindex.memory_index");
using document::ArrayFieldValue;
using document::WeightedSetFieldValue;
-using vespalib::LockGuard;
namespace search {
@@ -215,7 +214,7 @@ MemoryIndex::getNumWords() const {
void
MemoryIndex::pruneRemovedFields(const Schema &schema)
{
- LockGuard lock(_lock);
+ std::lock_guard lock(_lock);
if (_prunedSchema.get() == nullptr) {
auto newSchema = Schema::intersect(_schema, schema);
if (_schema == *newSchema) {
@@ -241,7 +240,7 @@ MemoryIndex::pruneRemovedFields(const Schema &schema)
Schema::SP
MemoryIndex::getPrunedSchema() const
{
- LockGuard lock(_lock);
+ std::lock_guard lock(_lock);
return _prunedSchema;
}
diff --git a/searchlib/src/vespa/searchlib/memoryindex/memory_index.h b/searchlib/src/vespa/searchlib/memoryindex/memory_index.h
index a9f153f7dd8..56eb4ad7a66 100644
--- a/searchlib/src/vespa/searchlib/memoryindex/memory_index.h
+++ b/searchlib/src/vespa/searchlib/memoryindex/memory_index.h
@@ -48,14 +48,14 @@ private:
std::unique_ptr<DocumentInverter> _inverter0;
std::unique_ptr<DocumentInverter> _inverter1;
DocumentInverter *_inverter;
- bool _frozen;
- uint32_t _maxDocId;
- uint32_t _numDocs;
- vespalib::Lock _lock;
- std::vector<bool> _hiddenFields;
- index::Schema::SP _prunedSchema;
+ bool _frozen;
+ uint32_t _maxDocId;
+ uint32_t _numDocs;
+ mutable std::mutex _lock;
+ std::vector<bool> _hiddenFields;
+ index::Schema::SP _prunedSchema;
vespalib::hash_set<uint32_t> _indexedDocs; // documents in memory index
- const uint64_t _staticMemoryFootprint;
+ const uint64_t _staticMemoryFootprint;
MemoryIndex(const MemoryIndex &) = delete;
MemoryIndex(MemoryIndex &&) = delete;