diff --git a/src/fdb5/database/Archiver.cc b/src/fdb5/database/Archiver.cc index 7b49b9cb4..3b1840546 100644 --- a/src/fdb5/database/Archiver.cc +++ b/src/fdb5/database/Archiver.cc @@ -42,7 +42,7 @@ void Archiver::archive(const Key& key, const void* data, size_t len) { void Archiver::archive(const Key& key, BaseArchiveVisitor& visitor) { - std::lock_guard lock(flushMutex_); + std::lock_guard lock(flushMutex_); visitor.rule(nullptr); dbConfig_.schema().expand(key, visitor); @@ -58,7 +58,7 @@ void Archiver::archive(const Key& key, BaseArchiveVisitor& visitor) { } void Archiver::flush() { - std::lock_guard lock(flushMutex_); + std::lock_guard lock(flushMutex_); for (auto i = databases_.begin(); i != databases_.end(); ++i) { // flush the store, pass the number of flushed fields to the catalogue i->second.catalogue_->flush(i->second.store_->flush()); @@ -92,7 +92,7 @@ void Archiver::selectDatabase(const Key& dbKey) { } if (found) { // flushing before evicting from cache - std::lock_guard lock(flushMutex_); + std::lock_guard lock(flushMutex_); databases_[oldK].catalogue_->flush(databases_[oldK].store_->flush()); diff --git a/src/fdb5/database/Archiver.h b/src/fdb5/database/Archiver.h index e2e525ac6..8d4b623b2 100644 --- a/src/fdb5/database/Archiver.h +++ b/src/fdb5/database/Archiver.h @@ -80,7 +80,7 @@ class Archiver : public eckit::NonCopyable { Database* db_; - std::mutex flushMutex_; + std::recursive_mutex flushMutex_; std::mutex cacheMutex_; const ArchiveCallback& callback_; };