diff options
author | Daniel Gottlieb <daniel.gottlieb@10gen.com> | 2017-03-02 10:39:08 -0500 |
---|---|---|
committer | Daniel Gottlieb <daniel.gottlieb@10gen.com> | 2017-03-02 11:21:41 -0500 |
commit | 6753fb211150d85eed71a84393bd13f2a07a8865 (patch) | |
tree | 1462df941741ffad092d47e12bab6555a91f5b6b /src/mongo/db/storage/mmap_v1/catalog/namespace_index.h | |
parent | e2d27510a270876a8b672171ce95c38b7c003199 (diff) | |
download | mongo-6753fb211150d85eed71a84393bd13f2a07a8865.tar.gz |
SERVER-18410: Replace RWLock with OperationContext/LockManager
Diffstat (limited to 'src/mongo/db/storage/mmap_v1/catalog/namespace_index.h')
-rw-r--r-- | src/mongo/db/storage/mmap_v1/catalog/namespace_index.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_index.h b/src/mongo/db/storage/mmap_v1/catalog/namespace_index.h index 8bcf836518c..51aae08ea61 100644 --- a/src/mongo/db/storage/mmap_v1/catalog/namespace_index.h +++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_index.h @@ -51,9 +51,17 @@ class NamespaceIndex { MONGO_DISALLOW_COPYING(NamespaceIndex); public: - NamespaceIndex(const std::string& dir, const std::string& database); + NamespaceIndex(OperationContext* txn, const std::string& dir, const std::string& database); ~NamespaceIndex(); + /** + * Must be called before destruction. + */ + void close(OperationContext* txn) { + LockMongoFilesExclusive lock(txn); + _f.close(txn); + } + /* returns true if the file represented by this file exists on disk */ bool pathExists() const; @@ -86,7 +94,7 @@ private: const std::string _dir; const std::string _database; - DurableMappedFile _f{MongoFile::Options::SEQUENTIAL}; + DurableMappedFile _f; std::unique_ptr<NamespaceHashTable> _ht; }; } |