diff options
Diffstat (limited to 'src/mongo/db/s/collection_sharding_state.cpp')
-rw-r--r-- | src/mongo/db/s/collection_sharding_state.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/s/collection_sharding_state.cpp b/src/mongo/db/s/collection_sharding_state.cpp index 7e38463b55e..687c9a877b1 100644 --- a/src/mongo/db/s/collection_sharding_state.cpp +++ b/src/mongo/db/s/collection_sharding_state.cpp @@ -58,7 +58,7 @@ public: : _factory(std::move(factory)) {} CollectionShardingState& getOrCreate(const NamespaceString& nss) { - stdx::lock_guard<stdx::mutex> lg(_mutex); + stdx::lock_guard<Latch> lg(_mutex); auto it = _collections.find(nss.ns()); if (it == _collections.end()) { @@ -74,7 +74,7 @@ public: BSONObjBuilder versionB(builder->subobjStart("versions")); { - stdx::lock_guard<stdx::mutex> lg(_mutex); + stdx::lock_guard<Latch> lg(_mutex); for (auto& coll : _collections) { const auto optMetadata = coll.second->getCurrentMetadataIfKnown(); @@ -93,7 +93,7 @@ private: std::unique_ptr<CollectionShardingStateFactory> _factory; - stdx::mutex _mutex; + Mutex _mutex = MONGO_MAKE_LATCH("CollectionShardingStateMap::_mutex"); CollectionsMap _collections; }; |