diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2017-10-27 01:57:52 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2017-10-27 08:50:17 +0000 |
commit | 2bf0eaac4188d9e6b0efc72599297b68f6e80486 (patch) | |
tree | 8026a53c1a980a4a758446ebd609473ab00556a8 /searchlib | |
parent | c1a847ff3e9cf48187131079c736e660474fe7d2 (diff) |
Reduce use of FastOS_Mutex and FastOS_Cond.
Remove handover tricks, use move constructor and move assignment instead.
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/docstore/compacter.cpp | 4 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/docstore/filechunk.cpp | 2 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/docstore/logdatastore.cpp | 14 |
3 files changed, 10 insertions, 10 deletions
diff --git a/searchlib/src/vespa/searchlib/docstore/compacter.cpp b/searchlib/src/vespa/searchlib/docstore/compacter.cpp index fa6a34db4ac..4d154da9907 100644 --- a/searchlib/src/vespa/searchlib/docstore/compacter.cpp +++ b/searchlib/src/vespa/searchlib/docstore/compacter.cpp @@ -16,7 +16,7 @@ void Compacter::write(LockGuard guard, uint32_t chunkId, uint32_t lid, const void *buffer, size_t sz) { (void) chunkId; FileChunk::FileId fileId= _ds.getActiveFileId(guard); - _ds.write(guard, fileId, lid, buffer, sz); + _ds.write(std::move(guard), fileId, lid, buffer, sz); } BucketCompacter::BucketCompacter(size_t maxSignificantBucketBits, const CompressionConfig & compression, LogDataStore & ds, ThreadExecutor & executor, const IBucketizer & bucketizer, FileId source, FileId destination) : @@ -92,7 +92,7 @@ BucketCompacter::write(BucketId bucketId, uint32_t chunkId, uint32_t lid, const LidInfo lidInfo(_sourceFileId.getId(), chunkId, sz); if (_ds.getLid(_lidGuard, lid) == lidInfo) { FileId fileId = getDestinationId(guard); - _ds.write(guard, fileId, lid, buffer, sz); + _ds.write(std::move(guard), fileId, lid, buffer, sz); } } diff --git a/searchlib/src/vespa/searchlib/docstore/filechunk.cpp b/searchlib/src/vespa/searchlib/docstore/filechunk.cpp index 93a85eda0aa..e9a1ffcda20 100644 --- a/searchlib/src/vespa/searchlib/docstore/filechunk.cpp +++ b/searchlib/src/vespa/searchlib/docstore/filechunk.cpp @@ -322,7 +322,7 @@ appendChunks(FixedParams * args, Chunk::UP chunk) if (args->db.getLid(args->lidReadGuard, e.getLid()) == lidInfo) { // I am still in use so I need to taken care of. vespalib::ConstBufferRef data(chunk->getLid(e.getLid())); - args->dest.write(guard, chunk->getId(), e.getLid(), data.c_str(), data.size()); + args->dest.write(std::move(guard), chunk->getId(), e.getLid(), data.c_str(), data.size()); } } } diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp index 1850db7b02b..6674952d202 100644 --- a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp +++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp @@ -179,14 +179,14 @@ LogDataStore::write(uint64_t serialNum, uint32_t lid, const void * buffer, size_ { LockGuard guard(_updateLock); WriteableFileChunk & active = getActive(guard); - write(guard, active, serialNum, lid, buffer, len); + write(std::move(guard), active, serialNum, lid, buffer, len); } void LogDataStore::write(LockGuard guard, FileId destinationFileId, uint32_t lid, const void * buffer, size_t len) { WriteableFileChunk & destination = static_cast<WriteableFileChunk &>(*_fileChunks[destinationFileId.getId()]); - write(guard, destination, destination.getSerialNum(), lid, buffer, len); + write(std::move(guard), destination, destination.getSerialNum(), lid, buffer, len); } void @@ -196,7 +196,7 @@ LogDataStore::write(LockGuard guard, WriteableFileChunk & destination, LidInfo lm = destination.append(serialNum, lid, buffer, len); setLid(guard, lid, lm); if (destination.getFileId() == getActiveFileId(guard)) { - requireSpace(guard, destination); + requireSpace(std::move(guard), destination); } } @@ -428,7 +428,7 @@ SerialNum LogDataStore::flushFile(LockGuard guard, WriteableFileChunk & file, Se } void LogDataStore::flushFileAndWait(LockGuard guard, WriteableFileChunk & file, SerialNum syncToken) { - syncToken = flushFile(guard, file, syncToken); + syncToken = flushFile(std::move(guard), file, syncToken); file.waitForDiskToCatchUpToNow(); _tlSyncer.sync(syncToken); file.flushPendingChunks(syncToken); @@ -437,13 +437,13 @@ void LogDataStore::flushFileAndWait(LockGuard guard, WriteableFileChunk & file, SerialNum LogDataStore::flushActive(SerialNum syncToken) { LockGuard guard(_updateLock); WriteableFileChunk &active = getActive(guard); - return flushFile(guard, active, syncToken); + return flushFile(std::move(guard), active, syncToken); } void LogDataStore::flushActiveAndWait(SerialNum syncToken) { LockGuard guard(_updateLock); WriteableFileChunk &active = getActive(guard); - return flushFileAndWait(guard, active, syncToken); + return flushFileAndWait(std::move(guard), active, syncToken); } bool LogDataStore::shouldCompactToActiveFile(size_t compactedSize) const { @@ -488,7 +488,7 @@ void LogDataStore::compactFile(FileId fileId) } else { LockGuard guard(_updateLock); WriteableFileChunk & compactTo = dynamic_cast<WriteableFileChunk &>(*_fileChunks[destinationFileId.getId()]); - flushFileAndWait(guard, compactTo, 0); + flushFileAndWait(std::move(guard), compactTo, 0); compactTo.freeze(); } compacter.reset(); |